gh-91162: Disallow tuple[T][*anything]#92255
Closed
mrahtz wants to merge 3 commits intopython:mainfrom
Closed
Conversation
Contributor
Author
|
Oops, sorry - while implementing another PR, I realised this is probably going to conflict with something else we'll need to do in |
| complexity to typing.py). This spec is currently being discussed at | ||
| https://github.com/python/cpython/issues/91162. | ||
| Note that not all the rules governing substitution behavior at runtime | ||
| is codified in PEPs; the source of truth for these tests is the tests |
Member
There was a problem hiding this comment.
Suggested change
| is codified in PEPs; the source of truth for these tests is the tests | |
| are codified in PEPs; the source of truth for these tests is the tests |
| return f'ForwardRef({self.__forward_arg__!r}{module_repr})' | ||
|
|
||
|
|
||
| def _is_unpacked_type(x: Any) -> bool: |
Member
There was a problem hiding this comment.
Suggested change
| def _is_unpacked_type(x: Any) -> bool: | |
| def _is_unpacked_type(x: object) -> bool: |
Contributor
Author
|
Thanks for the quick review anyway Jelle :) I'll integrate those suggestions in the upcoming PR. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
We agreed in #91162 that unpacked type arguments should only be valid to generic aliases that can accept a variable number of arguments - that is, unpacked type arguments should only be valid to generic aliases with a TypeVarTuple in the type parameters.
@JelleZijlstra Could I ask you for review on this?
(This PR is based on #92249, so there are a couple of extra commits. See the latest commit for the one that's actually part of this PR. I think I should be able to effectively hide the changes from the extra commits once #92249 is merged - so we can start review on this PR now?)