feat: Improve Parameter type safety with typed defaults and Unpack[_ParameterKwargs]#3394
Merged
dlstadther merged 3 commits intospotify:masterfrom Feb 21, 2026
Merged
Conversation
1afbe03 to
8429f75
Compare
dlstadther
previously approved these changes
Feb 21, 2026
dlstadther
approved these changes
Feb 21, 2026
Contributor
Author
|
@dlstadther Thank you for the merge! I'm excited to use it, so please release it whenever you have a chance. |
Collaborator
|
Will do @kitagry . I'd like to get the 3.8/3.9 removal merged before I release, if that's ok. |
Contributor
Author
|
No problem at all! Sounds like a good plan. |
Collaborator
|
@kitagry v3.8.0 was just released |
Contributor
Author
|
Thank you! |
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.
Description
_no_value = object()sentinel with a proper singleton class_NoValueTypedefaultargument to__init__of allParametersubclasses_ParameterKwargs(TypedDict) withUnpackto make**kwargstype-safeMotivation and Context
Previously,
**kwargshad no type information, making IDE autocompletion and static analysis with mypy ineffective. Additionally,_no_value = object()had an unclearreprduring debugging and could not be used in type annotations.Have you tested this? If so, how?