Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

is_of_type([], List[int]) throws an exception in 3.7 #59

Closed
mooncake4132 opened this issue Feb 14, 2019 · 1 comment
Closed

is_of_type([], List[int]) throws an exception in 3.7 #59

mooncake4132 opened this issue Feb 14, 2019 · 1 comment

Comments

@mooncake4132
Copy link

Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import typing
>>> import pytypes
>>> pytypes.is_of_type([], typing.List[int])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "D:\.virtualenvs\pytypes\lib\site-packages\pytypes\type_util.py", line 1904, in _isinstance
    bound_typevars_readonly, follow_fwd_refs, _recursion_check)
  File "D:\.virtualenvs\pytypes\lib\site-packages\pytypes\type_util.py", line 1769, in _issubclass
    bound_typevars_readonly, follow_fwd_refs, _recursion_check)
  File "D:\.virtualenvs\pytypes\lib\site-packages\pytypes\type_util.py", line 1799, in _issubclass_2
    bound_typevars_readonly, follow_fwd_refs, _recursion_check)
  File "D:\.virtualenvs\pytypes\lib\site-packages\pytypes\type_util.py", line 1310, in _issubclass_Generic
    bound_typevars_readonly, follow_fwd_refs, _recursion_check):
  File "D:\.virtualenvs\pytypes\lib\site-packages\pytypes\type_util.py", line 1769, in _issubclass
    bound_typevars_readonly, follow_fwd_refs, _recursion_check)
  File "D:\.virtualenvs\pytypes\lib\site-packages\pytypes\type_util.py", line 1799, in _issubclass_2
    bound_typevars_readonly, follow_fwd_refs, _recursion_check)
  File "D:\.virtualenvs\pytypes\lib\site-packages\pytypes\type_util.py", line 1293, in _issubclass_Generic
    if subclass.__origin__ is None:
AttributeError: type object 'Empty' has no attribute '__origin__'

This seems to be related to #32. I tested the above in python 3.6.5 and it worked fine, so it's only an issue in python 3.7.

@mooncake4132
Copy link
Author

Just noticed this is not python 3.7 ready yet #40 . Closing this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant