What if both typing.Literal and typing_extensions.Literal are available (e.g. typing_extensions.Literal used on Python 3.8)? Then I think this should work with both of them?
Edit: nevermind
Python 3.8.0 (default, Oct 21 2019, 20:27:53)
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import typing, typing_extensions
>>> typing.Literal is typing_extensions.Literal
True
What if both
typing.Literal
andtyping_extensions.Literal
are available (e.g.typing_extensions.Literal
used on Python 3.8)? Then I think this should work with both of them?Edit: nevermind