Repository navigation
Fix empty TypeVarTuple specialization on Python 3.10 - #832
Closed
LittleChenLiya wants to merge 1 commit into
Closed
LittleChenLiya wants to merge 1 commit into
LittleChenLiya wants to merge 1 commit into
Conversation
Allow a generic whose sole parameter is a TypeVarTuple to accept an empty argument tuple, matching newer Python versions. Keep rejecting empty specializations when required parameters remain. Fixes python#322
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #832 +/- ##
=======================================
Coverage 97.07% 97.08%
=======================================
Files 3 3
Lines 7583 7607 +24
=======================================
+ Hits 7361 7385 +24
Misses 222 222
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
AlexWaygood
reviewed
Nov 29, 2026
AlexWaygood
left a comment
Member
There was a problem hiding this comment.
This looks like a reasonable approach at first glance but, given that Python 3.10 is already end-of-life, I'm not sure it's worth making any changes to this library that only affect 3.10 at this point? The cost/benefit ratio seems too high at this point.
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.
Fixes #322
Python 3.10 rejects
Signal[()]beforetyping_extensionscan validate that the generic's only parameter is aTypeVarTuple. Preserve the empty alias for that case while retaining errors forGeneric[()]and generics with required leading parameters.Regression check:
python -m unittest test_typing_extensions.TypeVarTupleTests.test_empty_specializationfails before the fix withTypeError: Parameter list ... cannot be emptyand passes afterward on Python 3.10.