blob: 50f9712faf304208b21005fd9e509d2498d0f553 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
|
# pylint: disable=too-few-public-methods, useless-object-inheritance
"""test attribute access on metaclass"""
from __future__ import print_function
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(object):
"""metaclassed class"""
__metaclass__ = Meta
_meta_args = ('foo', 'bar')
def __init__(self):
print('__init__', self)
|