A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2003-March/034090.html below:

[Python-Dev] Re: Re: lists v. tuples

[Python-Dev] Re: Re: lists v. tuplesRaymond Hettinger python@rcn.com
Sun, 16 Mar 2003 16:59:56 -0500
> one minor problem with the six __lt__ etc is that they should be all defined.
> For quick things (although I know better) I still define just __cmp__ out of
> laziness.

Sometime back, I proposed a mixin for this.

class C(CompareMixin):
     def __eq__(self, other): ...
     def __lt__(self, other): ...

The __eq__ by itself is enough to get __ne__ defined for you.
Defining both __eq__ and __lt__ gets you all the rest.


Raymond Hettinger

#################################################################
#################################################################
#################################################################
#####
#####
#####
#################################################################
#################################################################
#################################################################



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4