[Python-Dev] Caching float(0.0)

"Martin v. Löwis" martin at v.loewis.de
Tue Oct 3 17:41:05 CEST 2006


Nick Maclaren schrieb:
> So distinguishing -0.0 from 0.0 isn't really in Python's current
> semantics at all.  And, for reasons that we could go into, I assert
> that it should not be - which is NOT the same as not supporting
> branch cuts in cmath.

Are you talking about "Python the language specification" or
"Python the implementation" here? It is not a change to the language
specification, as this aspect of the behavior (as you point out)
is unspecified. However, it is certainly a change to the observable
behavior of the Python implementation, and no amount of arguing
can change that.

Regards,
Martin

P.S. For that matter, *any* kind of changes to the singleton nature
of certain immutable values is a change in semantics. It's just that
dropping -0.0 is an *additional* change (on top of the change that
"1.0-1.0 is 0.0" would change from False to True).


More information about the Python-Dev mailing list