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 — Crash on type alias bounded by and defaulted to itself · Issue #21128 · python/mypy

Crash on type alias bounded by and defaulted to itself #21128

New issue
Copy link
New issue
Copy link
Closed
#21491
Closed
Crash on type alias bounded by and defaulted to itself#21128
#21491
Copy link
Labels
crashtopic-pep-696TypeVar defaultstopic-recursive-types

Description

@MeGaGiGaGon
MeGaGiGaGon
opened on Apr 1, 2026
Issue body actions

Crash Report

Found while messing around.

Traceback

Collapsed for readability
Deferral trace:
    __main__:1
    __main__:1
    __main__:1
    __main__:-1
    __main__:1
    __main__:1
    __main__:1
    __main__:1
    __main__:-1
    __main__:1
    __main__:1
    __main__:1
    __main__:1
    __main__:1
    __main__:1
    __main__:1
    __main__:1
    __main__:1
    __main__:1
    __main__:1
    __main__:1
    __main__:1
    __main__:1
    __main__:1
    __main__:1
    __main__:1
    __main__:1
    __main__:1
<string>: error: INTERNAL ERROR: maximum semantic analysis iteration count reached

To Reproduce

https://mypy-play.net/?mypy=master&python=3.14&gist=20fd30ebe61db2c71150e54a6c86a1bb

type A[T: A = A] = int
PS > uvx mypy@https://github.com/python/mypy.git --show-traceback -c 'type A[T: A = A] = int'

Your Environment

  • Mypy version used: Current master
  • Mypy command-line flags: --show-traceback -c "code"
  • Mypy configuration options from mypy.ini (and other config files): None
  • Python version used: 3.14? Whatever uvx does.
  • Operating system and version: Windows 11

Activity

  1. MeGaGiGaGon
    added
    crash
    on Apr 1, 2026
  2. brianschubert
    added
    topic-recursive-types
    topic-pep-695Issues related to PEP 695 syntax
    on Apr 1, 2026
  3. ilevkivskyi commented on Apr 1, 2026

    @ilevkivskyi
    ilevkivskyi
    on Apr 1, 2026
    Member
    More actions

    This is not specific to the new syntax, old style variant of this crashes as well, however with a different error:

    from typing import TypeVar
    
    T = TypeVar("T", default=A)
    
    A = list[T]
  4. ilevkivskyi commented on Apr 1, 2026

    @ilevkivskyi
    ilevkivskyi
    on Apr 1, 2026
    Member
    More actions

    Also I am tempted to mark this as a duplicate of #17716, but that one is specific to generic class, while this one is specific to a generic alias, so let's keep both open for now.

    Also @brianschubert I wold propose to use PEP 695 label only for issues that only happen with the new syntax (I removed the label from the other two issues as well).

    Reacted by Brian Schubert
  5. ilevkivskyi
    added
    topic-pep-696TypeVar defaults
    and removed
    topic-pep-695Issues related to PEP 695 syntax
    on Apr 1, 2026
  6. ilevkivskyi
    closed this as completedin 47ca4c2on May 26, 2026
  7. alicederyn
    added a commit that references this issue on May 26, 2026

    Fix various crashes on recursive type variable defaults (python#21491)

    47ca4c2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    crashtopic-pep-696TypeVar defaultstopic-recursive-types

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402775 — 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.