[Python-3000] Is __cmp__ deprecated?

Greg Ewing greg.ewing at canterbury.ac.nz
Fri Aug 24 05:36:25 CEST 2007


Guido van Rossum wrote:
> cmp() is still alive and __cmp__ is used to overload it; on the one
> hand I'd like to get rid of it but OTOH it's occasionally useful.

Maybe you could keep cmp() but implement it in terms
of, say, __lt__ and __eq__?
-- 
Greg Ewing, Computer Science Dept, +--------------------------------------+
University of Canterbury,	 | Carpe post meridiem! 	 |
Christchurch, New Zealand	 | (I'm not a morning person.) |
greg.ewing at canterbury.ac.nz	 +--------------------------------------+


More information about the Python-3000 mailing list

AltStyle によって変換されたページ (->オリジナル) /