Skip to content
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

Modernize type annotations using pyupgrade #3219

Merged
merged 1 commit into from
May 14, 2023
Merged

Modernize type annotations using pyupgrade #3219

merged 1 commit into from
May 14, 2023

Conversation

oprypin
Copy link
Contributor

@oprypin oprypin commented May 12, 2023

* https://peps.python.org/pep-0604/ - Allow writing union types as `X | Y`
* https://peps.python.org/pep-0585/ - Type Hinting Generics In Standard Collections
Copy link
Sponsor Contributor

@pawamoy pawamoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Did you use pyupgrade, or a mix of search/replace?

@pawamoy
Copy link
Sponsor Contributor

pawamoy commented May 12, 2023

There's a flake8 plugin that tells you if an import should be put under if TYPE_CHECKING. Ruff does that as well. Could be a nice linting addition.

@oprypin oprypin merged commit 62e3124 into master May 14, 2023
30 checks passed
@oprypin oprypin deleted the pyup branch May 14, 2023 20:49
@oprypin
Copy link
Contributor Author

oprypin commented May 14, 2023

Nice! Did you use pyupgrade, or a mix of search/replace?

pyupgrade and a bit of manual followup

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants