summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_metaclass.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/test/test_metaclass.py')
-rw-r--r--Lib/test/test_metaclass.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/Lib/test/test_metaclass.py b/Lib/test/test_metaclass.py
index b37b7de..07a333f 100644
--- a/Lib/test/test_metaclass.py
+++ b/Lib/test/test_metaclass.py
@@ -254,6 +254,33 @@ Test failures in looking up the __prepare__ method work.
[...]
test.test_metaclass.ObscureException
+Test setting attributes with a non-base type in mro() (gh-127773).
+
+ >>> class Base:
+ ... value = 1
+ ...
+ >>> class Meta(type):
+ ... def mro(cls):
+ ... return (cls, Base, object)
+ ...
+ >>> class WeirdClass(metaclass=Meta):
+ ... pass
+ ...
+ >>> Base.value
+ 1
+ >>> WeirdClass.value
+ 1
+ >>> Base.value = 2
+ >>> Base.value
+ 2
+ >>> WeirdClass.value
+ 2
+ >>> Base.value = 3
+ >>> Base.value
+ 3
+ >>> WeirdClass.value
+ 3
+
"""
import sys