Skip to content

Implement PEP 765 #130080

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.

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

Closed
iritkatriel opened this issue Feb 13, 2025 · 7 comments
Closed

Implement PEP 765 #130080

iritkatriel opened this issue Feb 13, 2025 · 7 comments
Assignees
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement

Comments

@iritkatriel
Copy link
Member

iritkatriel commented Feb 13, 2025

@iritkatriel iritkatriel self-assigned this Feb 13, 2025
iritkatriel added a commit to iritkatriel/cpython that referenced this issue Feb 13, 2025
iritkatriel added a commit to iritkatriel/cpython that referenced this issue Feb 13, 2025
iritkatriel added a commit to iritkatriel/cpython that referenced this issue Feb 13, 2025
@encukou encukou added type-feature A feature request or enhancement interpreter-core (Objects, Python, Grammar, and Parser dirs) labels Feb 13, 2025
iritkatriel added a commit to iritkatriel/cpython that referenced this issue Feb 18, 2025
iritkatriel added a commit to iritkatriel/cpython that referenced this issue Mar 6, 2025
iritkatriel added a commit that referenced this issue Mar 13, 2025
plashchynski pushed a commit to plashchynski/cpython that referenced this issue Mar 17, 2025
@hugovk
Copy link
Member

hugovk commented Mar 17, 2025

🚀

Final task, mark the the PEP as Final:

Once a PEP has been accepted, the reference implementation must be completed. When the reference implementation is complete and incorporated into the main source code repository, the status will be changed to “Final”.

https://peps.python.org/pep-0001/#pep-review-resolution

@picnixz
Copy link
Member

picnixz commented Mar 18, 2025

There are a bunch of warnings when executing the test suite now:

I'm re-opening the issue so that we fix the issues in the tests but you can open a separate issue if you want.

@picnixz picnixz reopened this Mar 18, 2025
iritkatriel added a commit to iritkatriel/cpython that referenced this issue Mar 18, 2025
iritkatriel added a commit to iritkatriel/cpython that referenced this issue Mar 19, 2025
iritkatriel added a commit to iritkatriel/cpython that referenced this issue Mar 19, 2025
colesbury pushed a commit to colesbury/cpython that referenced this issue Mar 20, 2025
colesbury pushed a commit to colesbury/cpython that referenced this issue Mar 20, 2025
@cdce8p
Copy link
Contributor

cdce8p commented Mar 22, 2025

#130087 seems to have introduce a regression were AST folding is now applied even if it shouldn't be. E.g.

# test.py
match a:
  case -1+2j:
    pass

With Python 3.13 (or 3.14a6)

$ python3.13 -m ast test.py
        ...
            match_case(
               pattern=MatchValue(
                  value=BinOp(
                     left=UnaryOp(
                        op=USub(),
                        operand=Constant(value=1)),
                     op=Add(),
                     right=Constant(value=2j))),
               body=[...

After #130087

$ python -m ast test.py
        ...
            match_case(
               pattern=MatchValue(
                  value=Constant(value=(-1+2j))),
               body=[...

@iritkatriel
Copy link
Member Author

#130087 seems to have introduce a regression were AST folding is now applied even if it shouldn't be. E.g.

Thanks, this is now fixed.

@WolframAlph
Copy link
Contributor

@iritkatriel I believe this memset is unnecessary:

memset(&state, 0, sizeof(_PyASTOptimizeState));

Here is PR: #131745

@iritkatriel
Copy link
Member Author

We do this in other places - set everything to 0 and then override other fields. If someone adds a new field which should be initialised to 0 they will probably not bother to update initialisation.

@WolframAlph
Copy link
Contributor

I see. Closing it then.

seehwan pushed a commit to seehwan/cpython that referenced this issue Apr 16, 2025
seehwan pushed a commit to seehwan/cpython that referenced this issue Apr 16, 2025
seehwan pushed a commit to seehwan/cpython that referenced this issue Apr 16, 2025
seehwan pushed a commit to seehwan/cpython that referenced this issue Apr 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

6 participants