mirror of
https://github.com/astral-sh/ruff.git
synced 2025-09-29 21:35:58 +00:00

This makes it easier to read and edit (and review changes to) these files as source, even though it doesn't affect the rendering.
456 B
456 B
Function shadowing
Parameter
Parameter x
of type str
is shadowed and reassigned with a new int
value inside the function.
No diagnostics should be generated.
def f(x: str):
x: int = int(x)
Implicit error
def f(): ...
f = 1 # error: "Implicit shadowing of function `f`; annotate to make it explicit if this is intentional"
Explicit shadowing
def f(): ...
f: int = 1