Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Next Next commit
Add failing test for __qualname__ type checking (fixes #20821)
  • Loading branch information
BHUVANSH855 committed Apr 13, 2026
commit cca081720fb63a57d83985e2f86948f11f7e8fbf
6 changes: 6 additions & 0 deletions test-data/unit/check-classes.test
Original file line number Diff line number Diff line change
Expand Up @@ -9412,3 +9412,9 @@ from typ import NT
def f() -> NT:
return NT(x='')
[builtins fixtures/tuple.pyi]

[case test_qualname_must_be_str]
class X:
__qualname__ = 5
[out]
error: "__qualname__" must be str