Skip to content

Unneccessary ast optimization #123403

@Eclips4

Description

@Eclips4

Bug report

Bug description:

AST optimizer is trying to optimize target of the following statements:

  • del statement (del a) - target is a target_list
  • Assign statement (a = b) target is a target_list
  • AugAssign statement (a += b) target is a augtarget
  • AnnAssign statement (a: int or a: int = 1) target is a augtarget
  • TypeAlias statement (type A = int) target is a identifier
  • For statement (for a in b: pass) target is a target_list
  • Async for statement (async for a in b: pass) target is a target_list

None of these targets contain anything that can be optimized.

CPython versions tested on:

CPython main branch

Operating systems tested on:

Linux

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    interpreter-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