On Mon, Feb 05, 2001 at 11:04:22AM -0800, Neil Schemenauer wrote: > On Mon, Feb 05, 2001 at 01:37:39PM -0500, Guido van Rossum wrote: > > Now, can you do things like this: > [example cut] > No, it would have to be written like this: > >>> from types import * > >>> class MyInt(IntType): # add a method > def add1(self): return self.value+1 Why ? Couldn't IntType do with an __add__[*] method that does this ugly magic for you ? Same for __sub__, __int__ and so on. *] Yes, yes, I know, it's a type, not a class, but you know what I mean :) -- Thomas Wouters <thomas@xs4all.net> Hi! I'm a .signature virus! copy me into your .signature file to help me spread!
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