[New-bugs-announce] [issue12286] float('nan') breaks sort() method on a list of floats

Johann C. Rocholl report at bugs.python.org
Wed Jun 8 19:39:47 CEST 2011


New submission from Johann C. Rocholl <jcrocholl at google.com>:

>>> l = [1.0, 2.0, 3.0, float('nan'), 4.0, 3.0, 2.0, 1.0]
>>> l.sort()
>>> l
[1.0, 2.0, 3.0, nan, 1.0, 2.0, 3.0, 4.0]

The expected result is either of the following:
[nan, 1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0] (similar to None)
[1.0, 1.0, 2.0, 2.0, 3.0, 3.0, 4.0, nan] (similar to string 'nan')

----------
messages: 137918
nosy: jcrocholl
priority: normal
severity: normal
status: open
title: float('nan') breaks sort() method on a list of floats
type: behavior

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


More information about the New-bugs-announce mailing list