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 builtin types instead of typing module for type hints #1983

Merged
merged 1 commit into from
Jul 10, 2023

Conversation

niklasmohrin
Copy link
Member

@niklasmohrin niklasmohrin commented Jul 10, 2023

Since Python 3.9, typing.List and friends are deprecated in favor of using the builtin types directly (for example list[int]). I used ruff to convert most of the occurrences and also fixed some other stuff it complained about. I think the most controversial change is Optional[T] vs T | None, because there is no deprecation or recommendation against the former and I would intuitively prefer it. However, we then agreed in the meeting that the latter is probably more intuitive for newcomers and kept it.

@niklasmohrin niklasmohrin force-pushed the typing-deprecations branch from bfe2063 to a44bec2 Compare July 10, 2023 20:08
@niklasmohrin niklasmohrin merged commit a045423 into e-valuation:main Jul 10, 2023
@niklasmohrin niklasmohrin deleted the typing-deprecations branch July 10, 2023 20:17
@niklasmohrin niklasmohrin restored the typing-deprecations branch September 18, 2023 15:47
@niklasmohrin niklasmohrin deleted the typing-deprecations branch September 18, 2023 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants