A RetroSearch Logo

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

Search Query:

Showing content from http://mail.python.org/pipermail/python-dev/2001-February/012699.html below:

[Python-Dev] Type/class differences (Re: Sets: elt in dict, lst.include)

[Python-Dev] Type/class differences (Re: Sets: elt in dict, lst.include) [Python-Dev] Type/class differences (Re: Sets: elt in dict, lst.include)Neil Schemenauer nas@arctrix.com
Tue, 6 Feb 2001 10:06:09 -0800
On Tue, Feb 06, 2001 at 03:57:12PM +0100, Thomas Wouters wrote:
> Why ? Couldn't IntType do with an __add__[*] method that does this ugly magic
> for you ? Same for __sub__, __int__ and so on.

You're right.  I'm pretty sure my modified interpreter would handle
"return self+1" just fine (I can't test it right now).  If you wanted to
override the __add__ method you would have to write "return
IntType.__add__(self, 1)".

  Neil



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