Fix JSON decoding for parameterized PEP 695 type aliases#780
Merged
Conversation
Co-Authored-By: Claude Opus 4.6 <[email protected]>
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.
Summary
type MaxLen[_T] = Annotated[_T, Len(max_length=4)]) was used as a field annotation likeMaxLen[list[str]], JSON decoding was skipped because__value__returned the rawAnnotated[_T, ...]with unsubstituted TypeVars_resolve_type_alias()and_substitute_typevars()helpers that properly substitute type parameters with concrete types when resolving parameterized TypeAliasType annotationsannotation = annotation.__value__pattern in_annotation_is_complex(),_get_field_metadata(), and_extract_field_info()with the new helperTest plan
test_annotated_with_parameterized_type_aliascovering all variants: traditional TypeVar alias, parameterized TypeAliasType, with ForceDecode, and with NoDecodetest_settings.pypass🤖 Generated with Claude Code