substitution __str__ method of an instance

Bruno Desthuilliers bruno.42.desthuilliers at websiteburo.invalid
Thu Oct 23 08:47:03 EDT 2008


Diez B. Roggisch a écrit :
> Christian Heimes wrote:
> 
>> netimen wrote:
>>> How can I substitute __str__ method of an instance?
>> It's not possible. For performance and other reasons most __*__ methods
>> are looked up on the type only.
> 
> Is that documented somewhere? I *know* it is that way, yet I'd like to have
> place to read up on it (and point to when this question pops up)

http://docs.python.org/reference/datamodel.html#special-method-lookup-for-new-style-classes




More information about the Python-list mailing list