[issue25843] code_richcompare() don't use constant type when comparing code constants

Larry Hastings report at bugs.python.org
Tue Jun 14 08:53:48 EDT 2016


Larry Hastings added the comment:

Someone asked on reddit.  The Misc/NEWS entry for this reads:

Issue #25843: When compiling code, don’t merge constants if they are equal but have a different types. For example, f1, f2 = lambda: 1, lambda: 1.0 is now correctly compiled to two different functions: f1() returns 1 (int) and f2() returns 1.0 (int), even if 1 and 1.0 are equal.

Shouldn't that last part read
 
"and f2() returns 1.0 (float), even if 1 and 1.0 are equal."
                       ^^^^^

As in, f2 returns a float, not an int.

If this is a mistake, let me fix it for 3.5.2 final and I'll merge it back into trunk etc.  If you fix it it wouldn't ship in 3.5.2 final.

----------
nosy: +larry

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue25843>
_______________________________________


More information about the Python-bugs-list mailing list