Skip to content

Commit 72f37db

Browse files
committed
add test case
1 parent a4289ec commit 72f37db

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

test-data/unit/pythoneval.test

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2163,3 +2163,21 @@ class C3[T1, T2](tuple[T1, ...]):
21632163

21642164
def func3(p: C3[int, object]):
21652165
x: C3[int, int] = p
2166+
2167+
2168+
[case testDynamicClassAttribute]
2169+
# Some things that can break if DynamicClassAttribute isn't handled properly
2170+
from types import DynamicClassAttribute
2171+
from enum import Enum
2172+
2173+
class TestClass:
2174+
@DynamicClassAttribute
2175+
def name(self) -> str: ...
2176+
2177+
class TestClass2(TestClass, Enum): ...
2178+
2179+
class Status(Enum):
2180+
ABORTED = -1
2181+
2182+
def imperfect(status: Status) -> str:
2183+
return status.name.lower()

0 commit comments

Comments
 (0)