gh-134280: Disable constant folding for ~ with a boolean argument#134982
Merged
serhiy-storchaka merged 4 commits intopython:mainfrom Jul 1, 2025
Merged
Conversation
This moves the deprecation warning from compile time to runtime.
Member
Author
|
3.14 and 3.13 differ from main, so I would do backporting step by step. |
Member
|
If we can detect this in https://github.com/python/cpython/blob/main/Python/ast_preprocess.c then we get the warning in both static analysis and execution. |
Member
Author
|
Yes, but we only add SyntaxWarning for very common errors. |
Member
|
Is it hard to detect this in the preprocessor? |
Member
Author
|
I do not know. But even a couple lines of code is a high price for this feature. And it will be more than a couple lines. |
timhoffm
reviewed
Jun 1, 2025
|
Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14. |
miss-islington
pushed a commit
to miss-islington/cpython
that referenced
this pull request
Jul 1, 2025
…nt (pythonGH-134982) This moves the deprecation warning from compile time to run time. (cherry picked from commit 86c3316) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
GH-136185 is a backport of this pull request to the 3.14 branch. |
serhiy-storchaka
added a commit
that referenced
this pull request
Jul 2, 2025
AndPuQing
pushed a commit
to AndPuQing/cpython
that referenced
this pull request
Jul 11, 2025
…nt (pythonGH-134982) This moves the deprecation warning from compile time to run time.
Pranjal095
pushed a commit
to Pranjal095/cpython
that referenced
this pull request
Jul 12, 2025
…nt (pythonGH-134982) This moves the deprecation warning from compile time to run time.
picnixz
pushed a commit
to picnixz/cpython
that referenced
this pull request
Jul 13, 2025
…nt (pythonGH-134982) This moves the deprecation warning from compile time to run time.
taegyunkim
pushed a commit
to taegyunkim/cpython
that referenced
this pull request
Aug 4, 2025
…nt (pythonGH-134982) This moves the deprecation warning from compile time to run time.
Agent-Hellboy
pushed a commit
to Agent-Hellboy/cpython
that referenced
this pull request
Aug 19, 2025
…nt (pythonGH-134982) This moves the deprecation warning from compile time to run time.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This moves the deprecation warning from compile time to runtime.
~booldeprecation not reported for literals #134280