lazy arithmetic

pianomaestro at gmail.com pianomaestro at gmail.com
Fri Aug 25 01:34:02 EDT 2006


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.

> 
> HTH,
> ~Simon




More information about the Python-list mailing list