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

Compatibility issue with Python 3.7 #117

Open
AiOO opened this issue May 3, 2019 · 1 comment
Open

Compatibility issue with Python 3.7 #117

AiOO opened this issue May 3, 2019 · 1 comment

Comments

@AiOO
Copy link
Collaborator

AiOO commented May 3, 2019

(This is not the same issue with as #116)

Since the typing module in Python 3.7 doesn't have _Union class, AttributeError occurs by below lines. To support Python 3.7 it should be fixed.

if hasattr(typing, '_Union'):
def is_union_type(type_):
return isinstance(type_, typing._Union)
def get_union_types(type_):
if is_union_type(type_):
return type_.__args__
else:
def is_union_type(type_):
return isinstance(type_, typing.UnionMeta)
def get_union_types(type_):
if is_union_type(type_):
return type_.__union_params__ \
if hasattr(type_, '__union_params__') \
else type_.__args__

p.s. @kanghyojun Could you explain why you used _Union instead of Union?

Relative links

@kanghyojun
Copy link
Member

kanghyojun commented May 7, 2019

It seems need to be fixed. But from 0.5.0, nirum-python nearly used for Python target. So why don't you re-create target package on new nirum compiler(0.5.0+).

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

2 participants