-
-
Notifications
You must be signed in to change notification settings - Fork 933
Use typing-extensions only on Python < 3.8 #1218
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
Conversation
Thanks a lot! Do you think that it would be possible to use |
I think you meant |
I think this was a clumsy way of asking if there is a less redundant way of specifying the imports. In |
Ah, like this? # git/compat.py:
if sys.version_info[:2] >= (3, 8):
import typing
else:
import typing_extensions as typing
# elsewhere:
from .compat import typing Unfortunately that has the annoying side effect of not being able to do |
f6d75c5
to
db4bdb4
Compare
@Byron, something like this? Or do you mean entirely replacing |
All necessary attributes are available in the built-in typing module since Python 3.8. Use typing-extensions only for older versions of Python, and avoid the unnecessary dep in 3.8+.
Thank you very much for this contribution, this looks good to me, and I assume @muggenhor saw nothing that would prevent a merge either. |
Thanks! We're removing Python 3.7 support real soon from Gentoo, and so we're going to be one step closer to eliminating typing-extensions as well ;-). |
Nope, didn't see any obstacles. It looks good! |
All necessary attributes are available in the built-in typing module
since Python 3.8. Use typing-extensions only for older versions
of Python, and avoid the unnecessary dep in 3.8+.