This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author xtreak
Recipients emilyemorehouse, serhiy.storchaka, xtreak
Date 2019-01-30.19:05:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1548875131.95.0.280347289465.issue35861@roundup.psfhosted.org>
In-reply-to
Content
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
History
Date User Action Args
2019-01-30 19:05:35xtreaksetrecipients: + xtreak, serhiy.storchaka, emilyemorehouse
2019-01-30 19:05:31xtreaksetmessageid: <1548875131.95.0.280347289465.issue35861@roundup.psfhosted.org>
2019-01-30 19:05:31xtreaklinkissue35861 messages
2019-01-30 19:05:31xtreakcreate