SyntaxWarning: "is" with a literal
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
uranium (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Linux Mint 20.3
python3-uranium 4.4.1-1
I see warning when I install "cura" package
$ sudo apt install cura
...
Setting up python3-uranium (4.4.1-1) ...
/usr/lib/
elif type(value) is list and len(value) is 2:
/usr/lib/
elif type(value) is list and len(value) is 3:
/usr/lib/
elif type(value) is list and len(value) is 4:
/usr/lib/
elif type(value) is list and type(value[0]) is list and len(value[0]) is 2:
Setting up python3-
Setting up uranium-plugins (4.4.1-1) ...
...
File /usr/lib/
uses "is" operator in a wrong way...
Simple demo:
$ cat test-is.py
#!/usr/bin/python3
s3 = "abc"
x = 1 + 2
print (len(s3), 3, x)
print (len(s3) is 3) # this is not good, python doesn't like this!!
print (len(s3) == 3)
print (len(s3) is x) # no problem for python...
print (len(s3) == x)
$ python3 test-is.py
test-is.py:6: SyntaxWarning: "is" with a literal. Did you mean "=="?
print (len(s3) is 3) # this is not good, python doesn't like this!!
3 3 3
True
True
True
True