[Python-3000] Please re-add __cmp__ to python 3000
Nick Coghlan
ncoghlan at gmail.com
Mon Nov 19 23:52:30 CET 2007
Jeffrey Yasskin wrote:
> For Python, I think I favor reviving __cmp__ for totally ordered
> types, and asking that partially ordered ones return NotImplemented
> from it explicitly.
Returning NotImplemented already means "I don't recognise the other
type". A fully implemented partial ordering is not the same thing.
None could possibly be coopted for the job of representing
unequal-but-not-ordered, but has the major downside of evaluating to
False as a truth value.
A new task-specific singleton as a Greg suggested is a definite
possibility though.
Cheers,
Nick.
--
Nick Coghlan | ncoghlan at gmail.com | Brisbane, Australia
---------------------------------------------------------------
http://www.boredomandlaziness.org
More information about the Python-3000
mailing list