aboutsummaryrefslogtreecommitdiff
path: root/tests/functional/m/metaclass_attr_access.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/functional/m/metaclass_attr_access.py')
-rw-r--r--tests/functional/m/metaclass_attr_access.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/functional/m/metaclass_attr_access.py b/tests/functional/m/metaclass_attr_access.py
new file mode 100644
index 000000000..50f9712fa
--- /dev/null
+++ b/tests/functional/m/metaclass_attr_access.py
@@ -0,0 +1,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)