lazy arithmetic
Simon Forman
rogue_pedro at yahoo.com
Fri Aug 25 01:59:32 EDT 2006
pianomaestro at gmail.com wrote:
> Simon Forman wrote:
>
> >
> > "Item.__add__ = Add" is a very strange thing to do, I'm not surprised
> > it didn't work.
>
> Yes it is strange.
> I also tried this even stranger thing:
>
> class Item(object):
> class __add__(object):
> def __init__(self, a, b=None):
> print self, a, b
> self.a = a
> self.b = b
>
> :)
>
> Simon.
That didn't work either did it? :-)
~Simon F.
More information about the Python-list
mailing list