Message 358464 - Python tracker

Message358464

Author Marco Sulla
Recipients Marco Sulla, brandtbucher, cheryl.sabella, mark.dickinson, rhettinger, serhiy.storchaka, tim.peters
Date 2019-12-16.05:17:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1576473443.12.0.635199233863.issue36095@roundup.psfhosted.org>
In-reply-to
Content
Excuse me, I had an epiphany.

NaN returns False for every comparison.

So in teory any element of the iterable should result minor that NaN.

So NaN should treated as the highest element, and should be at the end of the sorted result!

Indeed this is the behavior in Java. NaNs are in the end of the sorted iterator.

On the contrary, Python sorting does not move the NaN from its position.

Why?
History
Date User Action Args
2019-12-16 05:17:23Marco Sullasetrecipients: + Marco Sulla, tim.peters, rhettinger, mark.dickinson, serhiy.storchaka, cheryl.sabella, brandtbucher
2019-12-16 05:17:23Marco Sullasetmessageid: <1576473443.12.0.635199233863.issue36095@roundup.psfhosted.org>
2019-12-16 05:17:23Marco Sullalinkissue36095 messages
2019-12-16 05:17:22Marco Sullacreate