We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ae0d7a1 commit 2f2b8d1Copy full SHA for 2f2b8d1
conformance/tests/generics_self_advanced.py
@@ -33,8 +33,11 @@ class ChildB(ParentB):
33
34
def method2(self) -> None:
35
assert_type(self, Self)
36
- assert_type(self.a, list[Self])
37
- assert_type(self.a[0], Self)
+ # Allow type checkers to error here, since Self definitions on
+ # non-final classes are unsound.
38
+ a = self.a # E?
39
+ assert_type(a, list[Self])
40
+ assert_type(a[0], Self)
41
assert_type(self.method1(), Self)
42
43
@classmethod
0 commit comments