You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test-data/unit/check-classes.test
+37-4Lines changed: 37 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -4351,7 +4351,7 @@ class C(B):
4351
4351
class X(type): pass
4352
4352
class Y(type): pass
4353
4353
class A(metaclass=X): pass
4354
-
class B(A, metaclass=Y): pass # E: Inconsistent metaclass structure for "B"
4354
+
class B(A, metaclass=Y): pass # E: Metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases
class CQA(Q1): pass # E: Inconsistent metaclass structure for "CQA"
5217
-
class CQW(six.with_metaclass(M, Q1)): pass # E: Inconsistent metaclass structure for "CQW"
5216
+
class CQA(Q1): pass # E: Metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases
5217
+
class CQW(six.with_metaclass(M, Q1)): pass # E: Metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases
5218
5218
[builtins fixtures/tuple.pyi]
5219
5219
5220
5220
[case testSixMetaclassAny]
@@ -5319,7 +5319,7 @@ class C5(future.utils.with_metaclass(f())): pass # E: Dynamic metaclass not sup
5319
5319
5320
5320
class M1(type): pass
5321
5321
class Q1(metaclass=M1): pass
5322
-
class CQW(future.utils.with_metaclass(M, Q1)): pass # E: Inconsistent metaclass structure for "CQW"
5322
+
class CQW(future.utils.with_metaclass(M, Q1)): pass # E: Metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases
5323
5323
[builtins fixtures/tuple.pyi]
5324
5324
5325
5325
[case testFutureMetaclassAny]
@@ -6663,6 +6663,39 @@ class MyMetaClass(type):
6663
6663
class MyClass(metaclass=MyMetaClass):
6664
6664
pass
6665
6665
6666
+
6667
+
[case testMetaclassPlaceholderNode]
6668
+
from sympy.assumptions import ManagedProperties
6669
+
from sympy.ops import AssocOp
6670
+
reveal_type(AssocOp.x) # N: Revealed type is "sympy.basic.Basic"
6671
+
reveal_type(AssocOp.y) # N: Revealed type is "builtins.int"
6672
+
6673
+
[file sympy/__init__.py]
6674
+
6675
+
[file sympy/assumptions.py]
6676
+
from .basic import Basic
6677
+
class ManagedProperties(type):
6678
+
x: Basic
6679
+
y: int
6680
+
# The problem is with the next line,
6681
+
# it creates the following order (classname, metaclass):
0 commit comments