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

Reimplement Literal on Python <=3.10.0 #148

Merged
merged 2 commits into from
Apr 20, 2023

Conversation

AlexWaygood
Copy link
Member

@AlexWaygood AlexWaygood commented Apr 20, 2023

Fixes #147.

No code changes are required -- the typing_extensions reimplementation of Literal has never suffered from the same bug that was fixed in python/cpython#29334, because we don't cache Literal subscripts in the same way that CPython does. (I think if we wanted to do so, it might require us to reimplement @typing._tp_cache as it exists on CPython main, since the signature of _tp_cache changed between bugfix versions at some point.) As such, all we need to do is reimplement Literal on <=3.10.0 instead of <=3.9.0.

Cc. @dfremont :)

README.md Outdated Show resolved Hide resolved
Co-authored-by: Jelle Zijlstra <[email protected]>
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.

Backport fixes to Literal from 3.11?
2 participants