Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Inconsistentast.parse result forpython<3.11 and PEP654 #96587

Closed
Assignees
iritkatrielpablogsal
Labels
interpreter-core(Objects, Python, Grammar, and Parser dirs)type-bugAn unexpected behavior, bug, or error
@sobolevn

Description

@sobolevn

PEP654 introduced exception groups andexcept* in python3.11
Link:https://peps.python.org/pep-0654/

Right now it is possible to parseexcept* with olderast.parse(..., feature_version=(3, 10)).
Example:

>>>importast>>>code='''... try:...   ...... except* Exception:...   ...... '''>>>>>>ast.parse(code)<ast.Moduleobjectat0x10c685410>>>>ast.parse(code,feature_version=(3,8))<ast.Moduleobjectat0x10c685280>>>>

Which is not correct.

But, unlike#96427 it is very simple to fix. And I belive it should be fixed.

I've already applied a patch and will send it shortly after :)

Metadata

Metadata

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


    [8]ページ先頭

    ©2009-2025 Movatter.jp