Skip to content

AST optimizer skips PEP 696 type parameter defaults #123344

@JelleZijlstra

Description

@JelleZijlstra

Bug report

Bug description:

>>> dis.dis("def f[T = 1 + 2](): pass") ... snip ... L1: LOAD_CONST 0 (1) LOAD_CONST 1 (2) BINARY_OP 0 (+) ... snip ... 

cc @Eclips4. This is easy to fix but it might be better to wait for #122667 so we can test the fix better.

CPython versions tested on:

CPython main branch

Operating systems tested on:

No response

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.13bugs and security fixes3.14bugs and security fixesinterpreter-core(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions