-
-
Notifications
You must be signed in to change notification settings - Fork 187
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
collections.abc.Callable inside Option/Union broken in 3.9.0/3.9.1 #677
Comments
Thanks for the quick turnaround, appreciated ❤️ |
2 tasks
The-Compiler
added a commit
to qutebrowser/qutebrowser
that referenced
this issue
Oct 13, 2024
Did run with ruff pretending to use Python 3.10, because otherwise it won't reformat those: ruff check --select 'UP035' --fix --config 'target-version = "py310"' --unsafe-fixes This is because collections.abc.Callable inside Optional[...] and Union[...] is broken with Python 3.9.0 and 3.9.1: asottile/pyupgrade#677 astral-sh/ruff#2690 python/cpython#87131 However, pylint can detect problematic usages (of which we only have one), so we might as well use the new thing everywhere possible for consistency.
The-Compiler
added a commit
to qutebrowser/qutebrowser
that referenced
this issue
Oct 13, 2024
Did run with ruff pretending to use Python 3.10, because otherwise it won't reformat those: ruff check --select 'UP035' --fix --config 'target-version = "py310"' --unsafe-fixes This is because collections.abc.Callable inside Optional[...] and Union[...] is broken with Python 3.9.0 and 3.9.1: asottile/pyupgrade#677 astral-sh/ruff#2690 python/cpython#87131 However, pylint can detect problematic usages (of which we only have one), so we might as well use the new thing everywhere possible for consistency.
The-Compiler
added a commit
to qutebrowser/qutebrowser
that referenced
this issue
Oct 15, 2024
Did run with ruff pretending to use Python 3.10, because otherwise it won't reformat those: ruff check --select 'UP035' --fix --config 'target-version = "py310"' --unsafe-fixes This is because collections.abc.Callable inside Optional[...] and Union[...] is broken with Python 3.9.0 and 3.9.1: asottile/pyupgrade#677 astral-sh/ruff#2690 python/cpython#87131 However, pylint can detect problematic usages (of which we only have one), so we might as well use the new thing everywhere possible for consistency. Also see #7098
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The use of
collections.abc.Callable
insideOptional
/Union
is broken in Python 3.9.0 and 3.9.1.Recently, I've bumped pyupgrade from v2.34.0 to v2.37.0 and ran into this issue caused by refactoring done by pyupgrade.
pyupgrade with
--py39-plus
:Results in:
Which triggers: https://bugs.python.org/issue42965
The text was updated successfully, but these errors were encountered: