mirror of
https://github.com/astral-sh/ruff
synced 2026-01-22 14:00:51 -05:00
We mostly keep things the same here, but the message has been moved from the annotation to the diagnostic's top-line message. I think this is perhaps a little worse, but some bigger improvements could be made here. Indeed, we could perhaps even add a "fix" here.
223 B
223 B
Classes shadowing
Implicit error
class C: ...
C = 1 # error: "Implicit shadowing of class `C`"
Explicit
No diagnostic is raised in the case of explicit shadowing:
class C: ...
C: int = 1