-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
fixesRelated to suggested fixes for violationsRelated to suggested fixes for violations
Description
Given the following snippet, ruff should not throw an error. At least this is the behavior of pyupgrade.
There are cases where one still needs an explicit Optional. See fastapi/typer#348 / fastapi/typer#348 (comment) for an example.
Code
from __future__ import annotations
from typing import Optional
StrOrNone = Optional[str]
Output
up007.py:6:13: UP007 [*] Use `X | Y` for type annotations
Found 1 error.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
fixesRelated to suggested fixes for violationsRelated to suggested fixes for violations