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

Update typing_extensions imports for Python 3.9 #18383

Merged
merged 2 commits into from
Dec 30, 2024

Conversation

cdce8p
Copy link
Collaborator

@cdce8p cdce8p commented Dec 30, 2024

No description provided.

@cdce8p cdce8p requested a review from hauntsaninja December 30, 2024 08:38
Copy link
Collaborator

@hauntsaninja hauntsaninja left a comment

Choose a reason for hiding this comment

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

Looks good (although in my own code I've started moving to always importing everything from typing_extensions. This also makes runtime typing more robust)

This comment has been minimized.

@cdce8p
Copy link
Collaborator Author

cdce8p commented Dec 30, 2024

Looks good (although in my own code I've started moving to always importing everything from typing_extensions. This also makes runtime typing more robust)

True, you have to know exactly which typing versions in the stdlib have issues. Like collections.abc.Callable in 3.9.0 I mentioned in another PR. However, I do think the benefit of using stdlib imports is that you can faster check which version of typing_extensions is required for used features. E.g. if I see from typing_extensions import TypeVar, I'd have to use 4.12.0+ for TypeVar defaults.

Copy link
Contributor

According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅

@hauntsaninja hauntsaninja merged commit 1c427e7 into python:master Dec 30, 2024
19 checks passed
@cdce8p cdce8p deleted the 3.8-typing-extensions branch December 30, 2024 10:42
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.

2 participants