The __cmp__ method

__cmp__(self, other)

Called by comparison operations if rich comparison (see above) is not defined. Should return a negative integer if self < other, zero if self == other, a positive integer if self > other. If no __cmp__, __eq__ or __ne__ operation is defined, class instances are compared by object identity (address). See also the description of __hash__ for some important notes on creating objects which support custom comparison operations and are usable as dictionary keys. (Note: the restriction that exceptions are not propagated by __cmp__ has been removed since Python 1.5.)

 

A Django site. this page was rendered by a django application in 0.02s 2008-08-07 22:50:42.247643. hosted by webfaction.