6 Feb
2001
6 Feb
'01
6:57 a.m.
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!