Paolino wrote: > Little less ugly: > In [12]:class A(object): > ....: def __str__(self):return self.__str__() > ....: def str(self):return 'ciao' > ....: def setStr(self):self.__str__=self.str > ....: > > In [13]:a=A() > > In [14]:a.setStr() > > In [15]:str(a) > Out[15]:'ciao'
Not quite bug-free, by my eye that'll infintely recur if you call str(A()). -- http://mail.python.org/mailman/listinfo/python-list