We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3c16eea commit d6ad59dCopy full SHA for d6ad59d
test-data/unit/check-enum.test
@@ -29,7 +29,14 @@ class Medal(Achievement):
29
bronze = None
30
reveal_type(Medal.bronze) # E: Revealed type is '__main__.Medal'
31
m = Medal.gold
32
-m = 1 # E: Incompatible types in assignment (expression has type "int", variable has type "Medal")
+m = 1 # E: Incompatible types inassignment (expression has type "int", variable has type "Medal")
33
+
34
+[case testEnumFromEnumMetaGeneric]
35
+from enum import EnumMeta
36
+from typing import Generic, TypeVar
37
+T = TypeVar("T")
38
+class Medal(Generic[T], metaclass=EnumMeta): # E: Enum class cannot be generic
39
+ q = None
40
41
[case testEnumNameAndValue]
42
from enum import Enum
0 commit comments