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

gh-118772: Allow TypeVars without a default to follow those with a default when constructing aliases #118774

Merged
merged 2 commits into from
May 8, 2024

Conversation

JelleZijlstra
Copy link
Member

@JelleZijlstra JelleZijlstra commented May 8, 2024

@JelleZijlstra JelleZijlstra merged commit aac6b01 into python:main May 8, 2024
37 checks passed
@miss-islington-app
Copy link

Thanks @JelleZijlstra for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

@JelleZijlstra JelleZijlstra deleted the relaxdefailt branch May 8, 2024 16:54
@bedevere-app
Copy link

bedevere-app bot commented May 8, 2024

GH-118776 is a backport of this pull request to the 3.13 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.13 bugs and security fixes label May 8, 2024
JelleZijlstra added a commit that referenced this pull request May 8, 2024
…th a default when constructing aliases (GH-118774) (#118776)

(cherry picked from commit aac6b01)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
@AlexWaygood
Copy link
Member

Unfortunately I think it's infeasible to backport this to typing_extensions, unless we can think of some other approach to implement the same behaviour at typing_extensions. Here's the beginnings of a typing_extensions patch: https://github.com/python/typing_extensions/compare/main...AlexWaygood:typing_extensions:646-default-before-nondefault?expand=1. It passes tests on Python 3.11 and 3.12, but starts interfering with the typing.py internals in some quite fundamental ways on lower versions of Python due to the extensiveness of the monkeypatching. It's plausibly fixable, but it would require even more invasive monkeypatching, and I think it would make the code too fragile.

@AlexWaygood
Copy link
Member

Alright, here we go... python/typing_extensions#392

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.

None yet

2 participants