diff options
| author | Irit Katriel <1055913+iritkatriel@users.noreply.github.com> | 2024-03-26 15:18:17 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-26 15:18:17 (GMT) |
| commit | 79be75735c9d77972112cecc8d7e1af28c176ed0 (patch) | |
| tree | 243cf7ff18185b4aeb4f213c4571bc7e26793116 /Lib/test/test_metaclass.py | |
| parent | 70969d53a77a8a190c40a30419e772bc874a4f62 (diff) | |
| download | cpython-79be75735c9d77972112cecc8d7e1af28c176ed0.zip cpython-79be75735c9d77972112cecc8d7e1af28c176ed0.tar.gz cpython-79be75735c9d77972112cecc8d7e1af28c176ed0.tar.bz2 | |
gh-115775: Compiler adds __static_attributes__ field to classes (#115913)
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 36e8ab4..70f9c5d 100644 --- a/Lib/test/test_metaclass.py +++ b/Lib/test/test_metaclass.py @@ -167,6 +167,7 @@ Use a __prepare__ method that returns an instrumented dict. d['foo'] = 4 d['foo'] = 42 d['bar'] = 123 + d['__static_attributes__'] = () >>> Use a metaclass that doesn't derive from type. @@ -182,12 +183,12 @@ Use a metaclass that doesn't derive from type. ... b = 24 ... meta: C () - ns: [('__module__', 'test.test_metaclass'), ('__qualname__', 'C'), ('a', 42), ('b', 24)] + ns: [('__module__', 'test.test_metaclass'), ('__qualname__', 'C'), ('__static_attributes__', ()), ('a', 42), ('b', 24)] kw: [] >>> type(C) is dict True >>> print(sorted(C.items())) - [('__module__', 'test.test_metaclass'), ('__qualname__', 'C'), ('a', 42), ('b', 24)] + [('__module__', 'test.test_metaclass'), ('__qualname__', 'C'), ('__static_attributes__', ()), ('a', 42), ('b', 24)] >>> And again, with a __prepare__ attribute. @@ -208,8 +209,9 @@ And again, with a __prepare__ attribute. d['a'] = 1 d['a'] = 2 d['b'] = 3 + d['__static_attributes__'] = () meta: C () - ns: [('__module__', 'test.test_metaclass'), ('__qualname__', 'C'), ('a', 2), ('b', 3)] + ns: [('__module__', 'test.test_metaclass'), ('__qualname__', 'C'), ('__static_attributes__', ()), ('a', 2), ('b', 3)] kw: [('other', 'booh')] >>> |
