-
-
Notifications
You must be signed in to change notification settings - Fork 30.7k
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
Clarify SyntaxWarning with literal comparison #103492
Comments
https://docs.python.org/3/reference/lexical_analysis.html#literals
None is a constant, but not a 'literal' as defined in the sections above. This is only to say that the current message is not really ambiguous. Still, the added detail may help some. https://docs.python.org/3/reference/expressions.html#parenthesized-forms The test changes look good; can't review the c code. |
* main: pythongh-100227: Only Use deepfreeze for the Main Interpreter (pythongh-103794) pythongh-103492: Clarify SyntaxWarning with literal comparison (python#103493) pythongh-101100: Fix Sphinx warnings in `argparse` module (python#103289)
* superopt: pythongh-100227: Only Use deepfreeze for the Main Interpreter (pythongh-103794) pythongh-103492: Clarify SyntaxWarning with literal comparison (python#103493) pythongh-101100: Fix Sphinx warnings in `argparse` module (python#103289)
I had a coworker slightly confused about the following warning, since None is a literal and
is not None
is idiomatic:I think this would be better as:
Linked PRs
The text was updated successfully, but these errors were encountered: