You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the release of typing-extensions==4.6.0 the Literal type behaves in a weird way, i.e. it does not work at all on python 3.8.x and python3.9.x . Minimal example, let's call it mytap.py
from tap import Tap
from typing import Literal
class Parse(Tap):
pet: Literal["cat", "dog", "chinchilla"]
args = Parse().parse_args()
# 3.8+:
if hasattr(typing, 'Literal'):
Literal = typing.Literal
to
if sys.version_info >= (3, 10, 1):
Literal = typing.Literal
Now python 3.8.x and python 3.9.x get broken Literal types.
My hopes are that this will get fixed within typing-extensions soon. But in the meantime, could we fix typing-extensions in typing-argument-parser to typing-extensions>=3.7.4,<4.6.0 ?
The text was updated successfully, but these errors were encountered:
Thank you for raising this issue! We previously required the typing_extensions package to have support for the Literal type in Python version 3.7. However, as of yesterday (6/27/23), Python 3.7 is no longer supported. Therefore, we have removed the dependency on typing_extensions in this commit: c48ef74. This fix will be included in the next release.
With the release of
typing-extensions==4.6.0
theLiteral
type behaves in a weird way, i.e. it does not work at all on python 3.8.x and python3.9.x . Minimal example, let's call itmytap.py
Then we go
But with typing extensions 4.6.0
The issue popped out on pydantic yesterday. The issue happens because typing extensions changed:
to
Now python 3.8.x and python 3.9.x get broken Literal types.
My hopes are that this will get fixed within typing-extensions soon. But in the meantime, could we fix typing-extensions in typing-argument-parser to
typing-extensions>=3.7.4,<4.6.0
?The text was updated successfully, but these errors were encountered: