Message334587
SyntaxWarning was recently added for comparison using "is" over literals with issue34850. This is raised on master for a PEP 572 related test. The warning is emitted twice which is covered with bpo-35798 and I verified the patch. The fix for this issue would be to use == as noted in the warning.
Emily, if you can confirm my report then I would like to triage this as an easy one since the fix is simple.
# SyntaxWarning on master
➜ cpython git:(master) ./python.exe Lib/test/test_named_expressions.py
Lib/test/test_named_expressions.py:168: SyntaxWarning: "is" with a literal. Did you mean "=="?
if (match := 10) is 10:
Lib/test/test_named_expressions.py:168: SyntaxWarning: "is" with a literal. Did you mean "=="?
if (match := 10) is 10:
........................................................
----------------------------------------------------------------------
Ran 56 tests in 0.010s
OK
Thanks |
|
Date |
User |
Action |
Args |
2019-01-30 19:05:35 | xtreak | set | recipients:
+ xtreak, serhiy.storchaka, emilyemorehouse |
2019-01-30 19:05:31 | xtreak | set | messageid: <1548875131.95.0.280347289465.issue35861@roundup.psfhosted.org> |
2019-01-30 19:05:31 | xtreak | link | issue35861 messages |
2019-01-30 19:05:31 | xtreak | create | |
|