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

Use PEP 585 type hints #2094

Closed
jsangmeister opened this issue Jan 8, 2024 · 0 comments · Fixed by #2183
Closed

Use PEP 585 type hints #2094

jsangmeister opened this issue Jan 8, 2024 · 0 comments · Fixed by #2183
Assignees
Labels
clean up enhancement General enhancement which is neither bug nor feature
Milestone

Comments

@jsangmeister
Copy link
Contributor

Since https://peps.python.org/pep-0585/, type imports from the typing module are deprecated and should be replaced by the builtin classes or import from collections.abc (e.g. List[str]becomeslist[str]`. This simplifies the typing and removes unnecessary imports.

There exists an automatic upgrade tool (https://github.com/asottile/pyupgrade/) as well as a flake8 plugin to enforce this rule (https://pypi.org/project/flake8-pep585/). I would suggest applying the former and adding the latter to our dev setup.

@jsangmeister jsangmeister added clean up enhancement General enhancement which is neither bug nor feature labels Jan 8, 2024
@jsangmeister jsangmeister added this to the 4.2 milestone Jan 8, 2024
@jsangmeister jsangmeister self-assigned this Feb 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clean up enhancement General enhancement which is neither bug nor feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant