ruff/crates/red_knot_python_semantic/resources/mdtest/shadowing/class.md

276 B

Classes shadowing

Implicit error

class C: ...

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: ...

C: int = 1