Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
[3.14] Address invalid inputs of TypeAliasType #477
[3.14] Address invalid inputs of TypeAliasType #477
Changes from 12 commits
507088c
c00494a
4e2f041
b2412b0
54a67ab
64e4007
dccb363
4edee59
c928b20
9ad28aa
4b9a04c
6ba3f5e
e729c1f
83bbb98
ae88d98
6bc5c46
94b8c86
46ab3ac
b38852e
1ef3e00
cdf7fec
c14567d
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
We decided not to backport in CPython. This test should be changed so that typing_extensions does provide the backport.
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.
As
TypeAliasType
cannot be subclassed, I tried to do a minimal invasive workaround with__new__
to return thetyping
variant but this fails the pickling check.Do you know a workaround or is this
__new__
method not something to pursue further?At the moment the <3.12 backport would pass the test and would work as a full backport for 3.12 & 3.13.
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.
I think we can just use the pre-3.12 variant on 3.12 and 3.13.
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.
Guess with annotationlib (likely?) comming it needs a backport anyway.
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.
This needs to accept both the typing and typing_extensions versions of these classes, which are different on some versions. Test this.
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.
Yes, I saw this too, but realized that
_TypeVarLikeMeta
handlesisinstance
check.test_type_params_compatibility
test_type_var_compatibility
and the other methods test this.