We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
requires-python = ">=3.11" - repo: https://github.com/asottile/pyupgrade rev: v3.15.0 hooks: - id: pyupgrade args: - --py311-plus
currently i have a similar method:
from collections.abc import Awaitable class RedisPort: @abstractmethod - def srem(self, name: str, *values: bytes | str | float) -> Union[Awaitable[int], int]: + def srem(self, name: str, *values: bytes | str | float) -> Awaitable[int] | int: raise NotImplementedError
then pyupgrade try to change Union operator to | so the python raise TypeError exception:
(<class 'TypeError'>, unsupported operand type(s) for |: 'types.GenericAlias' and 'function', <traceback object at 0x7f2a3223f080>)
The text was updated successfully, but these errors were encountered:
when you instruct pyupgrade to --py311-plus you're telling it "I only run python 3.11 or newer" -- your error message is from python 3.9
--py311-plus
Sorry, something went wrong.
No branches or pull requests
currently i have a similar method:
then pyupgrade try to change Union operator to | so the python raise TypeError exception:
The text was updated successfully, but these errors were encountered: