GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Fix crash in new-style type alias with variadic unpack by ilevkivskyi · Pull Request #21551 · python/mypy

Fix crash in new-style type alias with variadic unpack #21551

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Sign up for GitHub

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
ilevkivskyi merged 1 commit into python:master from ilevkivskyi:fix-new-style-aliases
May 28, 2026

Uh oh!

There was an error while loading. Please reload this page.

Merged

Fix crash in new-style type alias with variadic unpack #21551

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
1 commit
Select commit
fe951df
Fix crash in new-style type alias with variadic unpack
ilevkivskyi May 27, 2026
File filter
Filter by extension

Clear filters
Conversations
Failed to load comments.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Jump to
Jump to file
Failed to load files.
Loading

Uh oh!

There was an error while loading. Please reload this page.

Diff view
Diff view
Fix crash in new-style type alias with variadic unpack
  • Loading branch information

Uh oh!

There was an error while loading. Please reload this page.

@ilevkivskyi
ilevkivskyi committed May 27, 2026
commit fe951df2c3a294f723e35cc15bb014659d5a7b98

There are no files selected for viewing

5 changes: 4 additions & 1 deletion 5 mypy/semanal.py
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -5771,7 +5771,10 @@ def visit_type_alias_stmt(self, s: TypeAliasStmt) -> None:
res = make_any_non_unimported(res)
eager = self.is_func_scope()
if isinstance(res, ProperType) and isinstance(res, Instance):
fix_instance(res, self.fail, self.note, disallow_any=False, options=self.options)
if not validate_instance(res, self.fail, indexed):
fix_instance(
res, self.fail, self.note, disallow_any=False, options=self.options
)
alias_node = TypeAlias(
res,
self.qualified_name(s.name.name),
Expand Down
13 changes: 13 additions & 0 deletions 13 test-data/unit/check-python312.test
Show comments
View file
Open in desktop
Original file line number Diff line number Diff line change
Expand Up @@ -2280,3 +2280,16 @@ class D[*Ts](Generic[Unpack[Us]]): # E: Generic[...] base class is redundant \
# E: Can only use one type var tuple in a class def
pass
[builtins fixtures/tuple.pyi]

[case testPEP695VariadicAliasUnpack]
class C[*Ts]:
pass

type T[T, *Ts] = C[*Ts]

x: T[bool, *tuple[()]]
reveal_type(x) # N: Revealed type is "__main__.C[()]"

y: T[bool]
reveal_type(y) # N: Revealed type is "__main__.C[()]"
[builtins fixtures/tuple.pyi]
Loading
Oops, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

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.
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.