Can print() be reloaded for a user defined class?

alex23 wuwei23 at gmail.com
Sun Sep 20 08:10:52 EDT 2009


Peng Yu <pengyu... at gmail.com> wrote:
> Is __repr__ = __str__ copy by reference or by value? If I change
> __str__ later on, will __repr__ be changed automatically?

What would you expect the outcome to be if these were functions rather
than class methods? (Or any type of object, really...)

Wouldn't it be quicker (and certainly less spammy) to test this out in
the interpreter?



More information about the Python-list mailing list