diff options
author | Antoine Pitrou <solipsis@pitrou.net> | 2011-11-25 18:56:07 +0100 |
---|---|---|
committer | Antoine Pitrou <solipsis@pitrou.net> | 2011-11-25 18:56:07 +0100 |
commit | 86a36b500a7f7581194382ce4df914e4bb487873 (patch) | |
tree | 0d83f90f9a14d40d3559ae188c203e9c8941c6db /Lib/test/test_metaclass.py | |
parent | 0e86a5842d0fadff37c299e8a1c03535c6727b19 (diff) | |
download | cpython-git-86a36b500a7f7581194382ce4df914e4bb487873.tar.gz |
PEP 3155 / issue #13448: Qualified name for classes and functions.
Diffstat (limited to 'Lib/test/test_metaclass.py')
-rw-r--r-- | Lib/test/test_metaclass.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/Lib/test/test_metaclass.py b/Lib/test/test_metaclass.py index 6862900b01..e6fe20a107 100644 --- a/Lib/test/test_metaclass.py +++ b/Lib/test/test_metaclass.py @@ -159,6 +159,7 @@ Use a __prepare__ method that returns an instrumented dict. ... bar = 123 ... d['__module__'] = 'test.test_metaclass' + d['__qualname__'] = 'C' d['foo'] = 4 d['foo'] = 42 d['bar'] = 123 @@ -177,12 +178,12 @@ Use a metaclass that doesn't derive from type. ... b = 24 ... meta: C () - ns: [('__module__', 'test.test_metaclass'), ('a', 42), ('b', 24)] + ns: [('__module__', 'test.test_metaclass'), ('__qualname__', 'C'), ('a', 42), ('b', 24)] kw: [] >>> type(C) is dict True >>> print(sorted(C.items())) - [('__module__', 'test.test_metaclass'), ('a', 42), ('b', 24)] + [('__module__', 'test.test_metaclass'), ('__qualname__', 'C'), ('a', 42), ('b', 24)] >>> And again, with a __prepare__ attribute. @@ -199,11 +200,12 @@ And again, with a __prepare__ attribute. ... prepare: C () [('other', 'booh')] d['__module__'] = 'test.test_metaclass' + d['__qualname__'] = 'C' d['a'] = 1 d['a'] = 2 d['b'] = 3 meta: C () - ns: [('__module__', 'test.test_metaclass'), ('a', 2), ('b', 3)] + ns: [('__module__', 'test.test_metaclass'), ('__qualname__', 'C'), ('a', 2), ('b', 3)] kw: [('other', 'booh')] >>> |