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

Fix typing.Literal support for Python 3.9 #104

Merged
merged 1 commit into from
Apr 24, 2023

Commits on Apr 24, 2023

  1. Check PY_310_MIN instead of PY_39_MIN

    Python 3.9.1 changed the `type()` of `Literal` instances to be
    `_LiteralGenericAlias` instead of `_GenericAlias`.
    
    `is_literal_type()` assumed the change took place in Python 3.9.0 and
    checked for it accordingly. Because the assumption was incorrect, it
    failed to detect `Literal` types in Python versions [3.9.0, 3.9.1).
    
    This commit changes `is_literal_type()` to check `PY_310_MIN` instead of
    `PY_39_MIN` to fix the issue.
    RA80533 committed Apr 24, 2023
    Configuration menu
    Copy the full SHA
    aba3857 View commit details
    Browse the repository at this point in the history