[docs] [issue11945] Adopt and document consistent semantics for handling NaN values in containers

Alexander Belopolsky report at bugs.python.org
Thu Apr 28 09:55:05 CEST 2011


Alexander Belopolsky <belopolsky at users.sourceforge.net> added the comment:

On Thu, Apr 28, 2011 at 3:26 AM, Nick Coghlan <report at bugs.python.org> wrote:
..
> 1. Write fully conformant implementations of IEEE754 floating point types, including the non-reflexive NaN comparisons
> (keeping in mind that, as a value-based specification, "same payload" is the closest IEEE754 can get to "same object")
>

If being "fully conformant" with various IEEE standards was a design
goal for Python, we would have leap seconds in the datetime module.
:-)

Python builtin float equality being reflexive does not in any way
inhibits anyone's ability to *write* a fully conforming
implementation.  In fact, if we ever get arithmetic operations
implemented for ctypes types, I would argue that c_double comparison
of c_double values would need to be changed to match C behavior.  (I
am +0 on changing that even without implementing arithmetics.)

I realize, however that by "status quo" you mean container operations
not calling __eq__ on identical objects.  I agree that this should not
change.  Making float comparison reflexive will actually make this
feature less controversial.

----------

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


More information about the docs mailing list