code confuses identity and equality

Bug #1932140 reported by Rolf Leggewie
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
mpmath (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

similar to bug 1917318

IMPACT:

Python 3.8 has started to emit warnings for code that confuses equality and identity. For more background see https://adamj.eu/tech/2020/01/21/why-does-python-3-8-syntaxwarning-for-is-literal/

While it is just a warning, it is very visible when running ansible on focal for example, to the point of making the output incredibly hard to follow. Furthermore, the indifference between identity and equality might be creating true bugs as discussed in above blog entry. It seems advisable to fix this incorrect code when found.

From the terminal when installing python3-mpmath:
Setting up python3-mpmath (1.1.0-2) ...
/usr/lib/python3/dist-packages/mpmath/ctx_mp_python.py:892: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if other is 0:
/usr/lib/python3/dist-packages/mpmath/ctx_mp_python.py:986: SyntaxWarning: "is" with a literal. Did you mean "=="?
  if other is 0:

This was fixed upstream in version 1.2.0 and thus does not affect hirsute and later.

Tags: focal
Rolf Leggewie (r0lf)
description: updated
Doug Torrance (profzoom)
Changed in mpmath (Ubuntu):
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.