We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1df1565 commit 82ad890Copy full SHA for 82ad890
conformance/tests/generics_self_advanced.py
@@ -40,6 +40,9 @@ def method2(self) -> None:
40
@classmethod
41
def method3(cls) -> None:
42
assert_type(cls, type[Self])
43
- assert_type(cls.a, list[Self])
44
- assert_type(cls.a[0], Self)
+ # Allow type checkers to error here, since Self definitions on
+ # non-final classes are unsound.
45
+ a = cls.a # E?
46
+ assert_type(a, list[Self])
47
+ assert_type(a[0], Self)
48
assert_type(cls.method1(), Self)
0 commit comments