PY-20026 Add test for the scenario provided by the user

The problem itself has been already remedied by the previous fix,
nonetheless, the example given by the user provides an interesting
case where we can encounter duplicate base classes in practice,
since we are not able to find out result of type(SomeClass) expression
yet.
This commit is contained in:
Mikhail Golubev
2016-08-16 17:52:56 +03:00
parent 9ec671069e
commit ccbe06603c
2 changed files with 33 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
# --- TypeField ---
class TypeFieldMeta(type):
pass
class TypeField(metaclass=TypeFieldMeta):
pass
# --- FieldedType ---
class FieldedTypeMeta(type):
pass
class FieldedType(metaclass=FieldedTypeMeta):
pass
# --- CompositeField ---
class CompositeFieldMeta(type(FieldedType), type(TypeField)):
# The superclass declaration is spelled they way it is to true and isolate this bit of code
# from the implementation details of whether or not FieldedType and TypeField have special
# metaclasses of their own or not and still get a metaclass MRO that keeps Python happy.
pass