Uh oh!
There was an error while loading. Please reload this page.
Use typing-extensions only on Python < 3.8 - #1218
Conversation
Byron
commented
Apr 21, 2021
Thanks a lot! Do you think that it would be possible to use |
muggenhor
commented
Apr 23, 2021
I think you meant |
Byron
commented
Apr 23, 2021
I think this was a clumsy way of asking if there is a less redundant way of specifying the imports. In |
muggenhor
commented
Apr 23, 2021
Ah, like this? # git/compat.py:ifsys.version_info[:2] >= (3, 8):
importtypingelse:
importtyping_extensionsastyping# elsewhere:from .compatimporttypingUnfortunately that has the annoying side effect of not being able to do |
f6d75c5 to
db4bdb4Comparemgorny
commented
Apr 23, 2021
@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+.
Byron
commented
Apr 24, 2021
Thank you very much for this contribution, this looks good to me, and I assume @muggenhor saw nothing that would prevent a merge either. |
mgorny
commented
Apr 24, 2021
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 ;-). |
muggenhor
commented
Apr 24, 2021
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+.