Using __repr__ or __str__ for own printable class?

Erik Max Francis max at alcyone.com
Fri Apr 18 20:01:08 CEST 2003


Steven Taschuk wrote:

> Reading this thread has made me wonder whether current practice is
> uniform.  It would not be desirable imho for the language
> reference to say, "people do different things with __repr__,
> including <list of three things>", and not endow one of them with
> some normative weight.
> 
> ... How about this?  (Draft.)

That sounds far superior to the current documentation, since it is more
verbose about what __str__ and __repr__ are used for in the field.

-- 
 Erik Max Francis / max at alcyone.com / http://www.alcyone.com/max/
 __ San Jose, CA, USA / 37 20 N 121 53 W / &tSftDotIotE
/  \ If you think you're free, there's no escape possible.
\__/ Baba Ram Dass
    Esperanto reference / http://www.alcyone.com/max/lang/esperanto/
 An Esperanto reference for English speakers.




More information about the Python-list mailing list