summaryrefslogtreecommitdiff
path: root/tests/functional/m/metaclass_attr_access.py
blob: 7d1faa5f51c6bcc75dc5a58d89cee14f3c900351 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# pylint: disable=too-few-public-methods
"""test attribute access on metaclass"""


class Meta(type):
    """the meta class"""
    def __init__(cls, name, bases, dictionary):
        super(Meta, cls).__init__(name, bases, dictionary)
        print(cls, cls._meta_args)
        delattr(cls, '_meta_args')


class Test:
    """metaclassed class"""
    __metaclass__ = Meta
    _meta_args = ('foo', 'bar')

    def __init__(self):
        print('__init__', self)