Brandt Bucher <brandtbuc...@gmail.com> added the comment:

Thanks for the feedback. I agree with you on the iffy delegation issue. 
However, this is problem that I feel deserves a fix... the behavior (silently 
producing garbage results) is just so un-pythonic. It’s been made clear in 
other issues that a warning isn’t right here, and sorting is guaranteed to use 
__lt__ (which NaN defines well for use in all other contexts). I honestly don’t 
see any other way. If that means fixing min, max, and friends too, I think it’s 
worth it.

Special cases justify special-casing, especially when doing so doesn’t break 
the rules. NaN isn’t like any other value of any other type; It’s practically 
defined by its ability to ruin valid comparison operations, even with fellow 
floats, for which ordering is otherwise well-defined.

For what it’s worth, I don’t know if anybody who’s tried to sort sets. Every 
Python programmer I know has blindly sorted floats at some point.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue36095>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to