[Python-Dev] PyObject_RichCompareBool identity shortcut

Antoine Pitrou solipsis at pitrou.net
Wed Apr 27 18:27:22 CEST 2011


On Wed, 27 Apr 2011 12:05:12 -0400 (EDT)
Isaac Morland <ijmorlan at uwaterloo.ca> wrote:
> On Wed, 27 Apr 2011, Alexander Belopolsky wrote:
> 
> > High performance applications that rely on non-reflexivity will still
> > have an option of using ctypes.c_float type or NumPy.
> 
> Python could also provide IEEE-754 equality as a function (perhaps in 
> "math"), something like:
> 
> def ieee_equal (a, b):
>  	return a == b and not isnan (a) and not isnan (b)

+1 (perhaps call it math.eq()).

Regards

Antoine.




More information about the Python-Dev mailing list