ilevkivskyi / typing_inspect

Runtime inspection utilities for Python typing module
MIT License
350 stars 35 forks source link

`typed_dict_keys` fails to return data on 3.10 #95

Open pschanely opened 1 year ago

pschanely commented 1 year ago

I presume this issue has something to do with typing_extensions, but not exactly sure how.

$ pip install typing-inspect==0.8.0
$ python
Python 3.10.8 (main, Dec 11 2022, 10:51:27) [Clang 11.0.3 (clang-1103.0.32.29)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from typing_inspect import typed_dict_keys
>>> from typing import TypedDict
>>> class A(TypedDict):
...   x: bool
... 
>>> typed_dict_keys(A)
>>> 

On Python 3.9 and 3.11, I get the expected return value of {'x': <class 'bool'>}

ilevkivskyi commented 1 year ago

Yeah, this is clearly a bug. I may not have time to look at it soon however, but PRs are welcome!