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

structure typing_extension.Literal to support old code #467

Merged
merged 1 commit into from
Dec 10, 2023

Conversation

petergaultney
Copy link
Contributor

@petergaultney petergaultney commented Dec 9, 2023

...or libraries that still support Python 3.7

would close #460

Comment on lines +213 to +218
return type in LITERALS or (
isinstance(
type, (_GenericAlias, _LiteralGenericAlias, _SpecialGenericAlias)
)
and type.__origin__ in LITERALS
)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is isomorphic to what typing-inspect does and it works in our company's testing as well.

@Tinche
Copy link
Member

Tinche commented Dec 10, 2023

LGTM. Just add the links to the PR and issues to the changelog and we're good to go.

@Tinche
Copy link
Member

Tinche commented Dec 10, 2023

Thanks!

@Tinche Tinche merged commit 3b6bdb7 into python-attrs:main Dec 10, 2023
8 checks passed
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

Successfully merging this pull request may close these issues.

support typing_extensions Literal
2 participants