-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UP007 should leave type aliases alone #2981
Labels
fixes
Related to suggested fixes for violations
Comments
Ah that's interesting. I think we used to not change this (following pyupgrade), but I didn't see a good reason not to, and changed it. We can revert. Note that pyupgrade will fix these cases: from __future__ import annotations
from typing import List
StrOrNone = List[str] |
might be wrong: I think this was just a limitation of mypy<1.0 |
Yeah that makes sense. Is there any sense for when fastapi/typer#522 would be merged? |
This was referenced Feb 24, 2023
charliermarsh
added a commit
that referenced
this issue
Feb 24, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Given the following snippet,
ruff
should not throw an error. At least this is the behavior ofpyupgrade
.There are cases where one still needs an explicit
Optional
. See fastapi/typer#348 / fastapi/typer#348 (comment) for an example.Code
Output
The text was updated successfully, but these errors were encountered: