Skip to content

Conversation

efimov-mikhail
Copy link
Member

@efimov-mikhail efimov-mikhail commented Jul 12, 2025

Now tests pass with all combinations of -OO and --without-doc-strings.
It was long lists of errors before, but all proposed fixes are just to add some needed optimize=False options.

@bedevere-app bedevere-app bot mentioned this pull request Jul 12, 2025
8 tasks
@bedevere-app bedevere-app bot added the tests Tests in the Lib/test dir label Jul 12, 2025
@Eclips4
Copy link
Member

Eclips4 commented Jul 17, 2025

I believe the explanation is as follows:
If the optimize parameter isn’t passed explicitly, the interpreter uses its internal setting (which can be modified using the -O or -OO flags).
Am I right, @efimov-mikhail?

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
@efimov-mikhail
Copy link
Member Author

efimov-mikhail commented Jul 17, 2025

If the optimize parameter isn’t passed explicitly, the interpreter uses its internal setting (which can be modified using the -O or -OO flags).

Exactly. I've added checks only in those tests that fail with -OO. We now force to run ast.parse and compile without optimizations to be sure that their results don't depend on runtime flags.

@Eclips4 Eclips4 merged commit 03017a8 into python:main Jul 18, 2025
40 checks passed
@Eclips4
Copy link
Member

Eclips4 commented Jul 18, 2025

Thank you @efimov-mikhail!

@efimov-mikhail
Copy link
Member Author

Thx for merge, @Eclips4 !

taegyunkim pushed a commit to taegyunkim/cpython that referenced this pull request Aug 4, 2025
…ls (python#136596)

Explicitly pass an `optimizer` parameter to the calls of `ast.parse/compile`, because if it is not provided, the interpreter will use its internal state, which can be modified using the `-O` or `-OO` flags.

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
Agent-Hellboy pushed a commit to Agent-Hellboy/cpython that referenced this pull request Aug 19, 2025
…ls (python#136596)

Explicitly pass an `optimizer` parameter to the calls of `ast.parse/compile`, because if it is not provided, the interpreter will use its internal state, which can be modified using the `-O` or `-OO` flags.

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip news tests Tests in the Lib/test dir

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants