Files
ruff/crates/red_knot_python_semantic/resources/mdtest/shadowing/class.md
Alex d77480768d [red-knot] Port type inference tests to new test framework (#13719)
## Summary

Porting infer tests to new markdown tests framework.

Link to the corresponding issue: #13696

---------

Co-authored-by: Carl Meyer <carl@astral.sh>
2024-10-15 11:23:46 -07:00

275 B

Classes shadowing

Implicit error

class C: pass
C = 1 # error: "Implicit shadowing of class `C`; annotate to make it explicit if this is intentional"

Explicit

No diagnostic is raised in the case of explicit shadowing:

class C: pass
C: int = 1