PY-27604 Exclude instantiated metaclasses from ancestor types of a class

but properly take them into account in PyClassType#getMetaClassType().

This check was implemented there instead of PyClass#getMetaClassType()
itself, since the former method already looks up for explicitly declared
metaclasses in ancestors unlike PyClassImpl that considers only those
specified directly in the class definition or its containing module.

Moreover, there are actual usages that expects such behavior from
PyClass#getMetaClassType(), e.g. PyAbstractClassInspection.
This commit is contained in:
Mikhail Golubev
2018-01-09 23:17:03 +03:00
parent f7da96db03
commit cbb5fe587a
5 changed files with 62 additions and 9 deletions

View File

@@ -0,0 +1,10 @@
class Meta(type):
pass
class Base(metaclass=Meta):
pass
class MyClass(Base):
pass