There was a regression in release 0.7.0 from 0.6.0.
Currently,
>>> from typing import List, Set
>>> from typing_inspect import get_args
>>> get_args(list[str]) # Yay this works! Great to see support for Python 3.9!
(<class 'str'>,)
>>> get_args(List)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/jessemichel/Dependencies/miniconda3/envs/py39/lib/python3.9/site-packages/typing_inspect.py", line 471, in get_args
res = tp.__args__
File "/Users/jessemichel/Dependencies/miniconda3/envs/py39/lib/python3.9/typing.py", line 694, in __getattr__
raise AttributeError(attr)
AttributeError: __args__
There was a regression in release 0.7.0 from 0.6.0.
Currently,
Previously,
I believe the fix would be changing this line: https://github.com/ilevkivskyi/typing_inspect/blob/d1d46f4c2429dd0a60f902fa7b728d67bb2d1582/typing_inspect.py#L471 to