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

Nick Coghlan report at bugs.python.org
Thu Apr 28 09:26:50 CEST 2011


Nick Coghlan <ncoghlan at gmail.com> added the comment:

By "works" I merely meant that you can currently achieve both of the following:

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")

2. Explicitly force reflexivity when you need it, either by filtering out nonconformant values, or by checking identity before checking equality.

The "pure" equality-tests-are-always-reflexive approach advocated by Meyer rules out option 1. Given that one of the use cases for Python is to prototype algorithms that are later translated to C or C++, formally disallowing that use case would be problematic.

----------

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


More information about the docs mailing list