-
Notifications
You must be signed in to change notification settings - Fork 421
feat: only install typing-extensions dependency when necessary #280
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
Comments
Thanks @nadobando! I'll have a look at the PR shortly. |
This was referenced Feb 3, 2021
Now available in 1.10.2! Thank you very much for this |
2 tasks
typing-extensions are also needed in say, version 3.8 to use type hints from later versions
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Key information
Summary
typing-extensions module is a backport for typing hint for old versions of python <= 3.5
in this project many times typing-extensions is imported to use the Literal type hint which is already natively included in python >= 3.8
Motivation
There is no need for this package in Python >= 3.8 and we are currently enforced to install it
Proposal
add if try/except blocks based on the python version
this is not really a design, it's more a check to wether import typing-extensions or not based on the system python version
in order to use it right instead of importing typing_extensions we can include the dependency in the file types.py and then import that dependency from the types.py as showed in the code blocks
Drawbacks
since this is not a design it's more an improvement of a dependency import I don't see a drawback
Rationale and alternatives
The impact of not doing this will be the used of a backport library which is not needed by the interpreter as it has the native implementation
Unresolved questions
no questions
The text was updated successfully, but these errors were encountered: