SyntaxWarning: "is" with a literal
ionutnechita opened this issue · comments
Hi,
I observe this warning:
SyntaxWarning: "is" with a literal
visitor.py. line 32,34,260
Ubuntu 20.04.1 LTS
python3 --version
Python 3.8.2
Hi,
When I install python3-jmespath
(version 0.9.4-2) using apt
, I also get similar warnings:
Setting up python3-jmespath (0.9.4-2) ...
/usr/lib/python3/dist-packages/jmespath/visitor.py:32: SyntaxWarning: "is" with a literal. Did you mean "=="?
if x is 0 or x is 1:
/usr/lib/python3/dist-packages/jmespath/visitor.py:32: SyntaxWarning: "is" with a literal. Did you mean "=="?
if x is 0 or x is 1:
/usr/lib/python3/dist-packages/jmespath/visitor.py:34: SyntaxWarning: "is" with a literal. Did you mean "=="?
elif y is 0 or y is 1:
/usr/lib/python3/dist-packages/jmespath/visitor.py:34: SyntaxWarning: "is" with a literal. Did you mean "=="?
elif y is 0 or y is 1:
/usr/lib/python3/dist-packages/jmespath/visitor.py:260: SyntaxWarning: "is" with a literal. Did you mean "=="?
if original_result is 0:
Looks like bugs to me, as the is
keyword in Python is used to "Check if two objects are the same object" (i.e. check references), and
0and
1` are not objects/references...