This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rhettinger
Recipients brandtbucher, cheryl.sabella, mark.dickinson, rhettinger, serhiy.storchaka, tim.peters
Date 2019-02-23.22:42:07
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1550961727.93.0.918807491916.issue36095@roundup.psfhosted.org>
In-reply-to
Content
-1 I am flat opposed to special casing the list.sort() code for the specific case of NaNs.  

This is an incorrect delegation of responsibility.  The sorted objects are responsible for saying how they will sort and whether than is. deterministic.  Note, float('NaN') isn't the only case.  Sets objects only have a partial ordering.

Also note that list.sort() isn't the only tool that compares objects.  There is also min(), max(), heaps, bisect, etc.  For the most part, we've able to keep those all it sync with one another by a clear separation of responsibilities (objects decide how they are compared versus tools that use comparisons).

At the very least, this would need a python-ideas discussion. FWIW, the usual solution to this problem is to strip the NaN values using math.isnan().
History
Date User Action Args
2019-02-23 22:42:07rhettingersetrecipients: + rhettinger, tim.peters, mark.dickinson, serhiy.storchaka, cheryl.sabella, brandtbucher
2019-02-23 22:42:07rhettingersetmessageid: <1550961727.93.0.918807491916.issue36095@roundup.psfhosted.org>
2019-02-23 22:42:07rhettingerlinkissue36095 messages
2019-02-23 22:42:07rhettingercreate