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
Support Literal (PEP 586) #39
Conversation
Adds an `is_literal_type` API, and fixes `get_args` for literal types on 3.6 and 2.7 (provided by typing_extensions). This feature is in 3.8, but it's available as a backport to 3.7 and below as part of `typing_extensions`, so this adds `typing_extensions` as a dependency. I've tested this pull request by running the unit tests against Python 2.7, 3.6, and 3.7.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for PR! Looks good.
I am going to close and re-open to trigger Travis build with new master. |
It looks like this missed adding a check in |
@anntzer Yes, the origin should be |
Adds an
is_literal_type
API, and fixesget_args
for literal types on 3.6 and 2.7 (provided bytyping_extensions
).This feature is in 3.8, but it's available as a backport to 3.7 and below as part of
typing_extensions
, so this addstyping_extensions
as a dependency.I've tested this pull request by running the unit tests against Python 2.7, 3.6, and 3.7.