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

2011-06-08 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: This is actually a duplicate of issue7915. I don't think there is nothing we can do to improve the situation. In fact discussion at #11949 ends with a +0 from Mark Dickinson to issue a warning whenever nans participate in order comparison. Discussion a

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

2011-06-08 Thread Ezio Melotti
Ezio Melotti added the comment: This is expected. See also #11986 and #11949. -- nosy: +belopolsky, ezio.melotti, mark.dickinson, rhettinger resolution: -> invalid stage: -> committed/rejected status: open -> closed ___ Python tracker

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

2011-06-08 Thread Johann C. Rocholl
New submission from Johann C. Rocholl : >>> 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,