-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
gh-134280: Disable constant folding for ~ with a boolean argument #134982
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
gh-134280: Disable constant folding for ~ with a boolean argument #134982
Conversation
This moves the deprecation warning from compile time to runtime.
3.14 and 3.13 differ from main, so I would do backporting step by step. |
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. |
Yes, but we only add SyntaxWarning for very common errors. |
Is it hard to detect this in the preprocessor? |
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. |
Thanks @serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.14. |
…nt (pythonGH-134982) This moves the deprecation warning from compile time to run time. (cherry picked from commit 86c3316) Co-authored-by: Serhiy Storchaka <[email protected]>
GH-136185 is a backport of this pull request to the 3.14 branch. |
This moves the deprecation warning from compile time to runtime.
~bool
deprecation not reported for literals #134280