File tree 2 files changed +19
-0
lines changed
2 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -3194,6 +3194,23 @@ C2().foo()
3194
3194
C2().bar()
3195
3195
C2().baz() # E: "C2" has no attribute "baz"
3196
3196
3197
+ [case testSixWithMetaclassGenerics]
3198
+ from typing import Generic, GenericMeta, TypeVar
3199
+ import six
3200
+ class DestroyableMeta(type):
3201
+ pass
3202
+ class Destroyable(six.with_metaclass(DestroyableMeta)):
3203
+ pass
3204
+ T_co = TypeVar('T_co', bound='Destroyable', covariant=True)
3205
+ class ArcMeta(GenericMeta, DestroyableMeta):
3206
+ pass
3207
+ class Arc(six.with_metaclass(ArcMeta, Generic[T_co], Destroyable)):
3208
+ pass
3209
+ class MyDestr(Destroyable):
3210
+ pass
3211
+ reveal_type(Arc[MyDestr]()) # E: Revealed type is '__main__.Arc[__main__.MyDestr*]'
3212
+ [builtins fixtures/bool.pyi]
3213
+
3197
3214
[case testSixWithMetaclassErrors]
3198
3215
import six
3199
3216
class M(type): pass
Original file line number Diff line number Diff line change 3
3
4
4
from abc import abstractmethod
5
5
6
+ class GenericMeta (type ): pass
7
+
6
8
cast = 0
7
9
overload = 0
8
10
Any = 0
You can’t perform that action at this time.
0 commit comments