Closed
Description
- A minimal code snippet that reproduces the bug.
https://docs.astral.sh/ruff/rules/redundant-none-literal mentions that the rule is sometimes autofixable, but I landed on the following cases which are not autofixed and I believe should:
def get_rotation(rotation: float | Literal[None, "horizontal", "vertical"]) -> float: ...
def spy(
Z,
precision: float | Literal["present"] = ...,
marker=...,
markersize=...,
aspect: Literal["equal", "auto", None] | float = ...,
origin: Literal["upper", "lower"] = ...,
**kwargs,
) -> tuple[AxesImage, Line2D]: ...
class Axes(_AxesBase):
def spy(
self,
Z,
precision: float | Literal["present"] = 0,
marker=...,
markersize=...,
aspect: Literal["equal", "auto", None] | float = "equal",
origin: Literal["upper", "lower"] = ...,
**kwargs,
) -> AxesImage | Line2D: ...
-
The command you invoked
ruff check --fix --preview --select=PYI061 --isolated
-
The current Ruff version (
ruff --version
).
ruff 0.8.0