gh-126085: Add tp_iter to TypeAliasType to allow star unpacking#127981
Merged
JelleZijlstra merged 13 commits intopython:mainfrom Mar 4, 2025
Merged
gh-126085: Add tp_iter to TypeAliasType to allow star unpacking#127981JelleZijlstra merged 13 commits intopython:mainfrom
tp_iter to TypeAliasType to allow star unpacking#127981JelleZijlstra merged 13 commits intopython:mainfrom
Conversation
picnixz
reviewed
Dec 16, 2024
Misc/NEWS.d/next/Core_and_Builtins/2024-12-15-16-56-26.gh-issue-126085.BvyEXk.rst
Outdated
Show resolved
Hide resolved
picnixz
reviewed
Dec 16, 2024
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Member
ZeroIntensity
left a comment
There was a problem hiding this comment.
Mostly LGTM, with two comments.
Misc/NEWS.d/next/Core_and_Builtins/2024-12-15-16-56-26.gh-issue-126085.BvyEXk.rst
Outdated
Show resolved
Hide resolved
picnixz
approved these changes
Dec 16, 2024
Objects/typevarobject.c
Outdated
|
|
||
| #include "clinic/typevarobject.c.h" | ||
|
|
||
| #define typevartuple_iter unpack_iter |
Member
There was a problem hiding this comment.
I don't think we need these defines, just use unpack_iter directly.
Member
Author
There was a problem hiding this comment.
This was a suggestion from @ZeroIntensity to keep the naming more consistent. I can remove them though
Member
There was a problem hiding this comment.
I was complaining originally about the naming inconsistency, but in hindsight, it's probably better than the extra #define.
Member
Author
There was a problem hiding this comment.
I'll remove them (and fix the conflict) later today :)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
JelleZijlstra
approved these changes
Mar 4, 2025
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.
As @JelleZijlstra suggested, this simply adds a
tp_iterslot that returnsUnpack[self], same as we do for TypeVarTuple.Feedback welcome!
📚 Documentation preview 📚: https://cpython-previews--127981.org.readthedocs.build/en/127981/library/typing.html#typing.TypeAliasType