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'

The point is str(ob) builtin looks like calling 
ob.__class__.__str__(ob).Prolly Python-dev is the good place to ask about.



        

        
                
___________________________________ 
Yahoo! Mail: gratis 1GB per i messaggi e allegati da 10MB 
http://mail.yahoo.it
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to