Skip to content

Fix subscripted generic PEP 695 type aliases - #817

Merged
yukinarit merged 1 commit into
yukinarit:mainfrom
SAY-5:fix-generic-pep695-type-alias
Oct 28, 2026
Merged

yukinarit merged 1 commit into
yukinarit:mainfrom
SAY-5:fix-generic-pep695-type-alias

Conversation

@SAY-5

@SAY-5 SAY-5 commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

Fixes #804

A subscripted generic alias like Polygon[float] is a GenericAlias whose origin is the TypeAliasType, so is_pep695_type_alias did not recognize it and the renderers raised Unsupported type: Polygon. It is now treated as an alias too, and the type arguments are substituted into the alias __value__ by matching them against __type_params__, so nested aliases such as Point[T] inside Polygon[T] resolve as well.

Signed-off-by: Sai Asish Y <say.apm35@gmail.com>
@yukinarit yukinarit added the bug Bug report or fix label Oct 28, 2026

@yukinarit yukinarit left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@yukinarit
yukinarit merged commit fd94270 into yukinarit:main Oct 28, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Bug report or fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Genelic type statement is not supported

2 participants