-
-
Couldn't load subscription status.
- Fork 3k
Refactor: migrate imports from typing_extensions to typing (Issue #8043) #20130
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
base: master
Are you sure you want to change the base?
Refactor: migrate imports from typing_extensions to typing (Issue #8043) #20130
Conversation
This comment has been minimized.
This comment has been minimized.
|
This Edit: also, to be clear, I'm not a maintainer and have no say over whether this PR ultimately gets accepted. I just happen to know some things about this codebase. |
2b14b4f to
c3f279e
Compare
137a7c8 to
b6561e2
Compare
for more information, see https://pre-commit.ci
|
According to mypy_primer, this change doesn't affect type check results on a corpus of open source code. ✅ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to have a ^M binary character (carriage return) added into it, which unfortunately makes github think it's a binary file and not preview it correctly. In whatever text editor you use, try selecting "LF" or "Unix" line endings. You can also just run git config core.autocrlf input to have git correct these errors for this project.
|
All tests are now passing ✅ |
|
The current PR as pushed to GitHub only modifies one of the files you speak about in your OP, and in fact only makes one change. Is this an intentional scale back of the scope of your PR or are you missing some stuff? (While this is a question I'm posing to you, this is probably the last time I'm going to comment on this pull request.) (Also, note that you should mark a pull request as draft while you work on it. You just said ready for review, which is the opposite of draft, but if you realize it's not ready for review, you should mark it as draft until it's ready.) |
Thanks for catching that! |
|
Agree with @wyattscarpenter analysis: .gitignore change should definitely be reverted, there's no sane reason to change gitignore while adjusting some import sources. Furthermore, I do not think this task should be performed manually - there are autofixer tools that can handle that much better than humans. I'm specifically talking about ruff's UP035, which is already enabled in our codebase. Addressing specifically so that import from
This PR now contains changes for two files: |
Addresses part of #8043
This pull request refactors several modules to replace imports from typing_extensions with standard library typing, whenever the imported symbols are already available in the corresponding Python versions supported by MyPy.
Motivation:
Addresses part of issue #8043 ("Remove imports from typing_extensions where not needed").
Reduces dependency on typing_extensions and simplifies the import structure.
Promotes cleaner, more consistent imports across the codebase.
Changes include:
Updated imports in the following modules: