__str__ vs. __repr__

Emile van Sebille emile at fenx.com
Thu Nov 4 09:52:11 EST 1999


----- Original Message -----
From: Guido van Rossum <guido at cnri.reston.va.us>
To: Tim Peters <tim_one at email.msn.com>
Cc: <python-list at python.org>
Sent: Wednesday, November 03, 1999 5:57 PM
Subject: Re: __str__ vs. __repr__
<snip>
> Any suggestions?
>
> --Guido van Rossum (home page: http://www.python.org/~guido/)


It seems to me that issues arise when using the interactive interpreter.
I suspect that little useful work is done in this mode, and is used
predominately for quick testing while creating python programs.

Also, as entering a value without the print is a shortcut/convenience
used during testing, why not supply even more information?  Supply the
class, type, lengths, indexes, nested, pretty-printed, etc.  Use the
repr and str if it helps.  Interactive mode is for learning, testing,
and experimenting.  Let it be of as much help as possible.

I-type-print-so-fast-sometimes-it-comes-out-printprint-ly yr's


Emile van Sebille
emile at fenx.com
-------------------








More information about the Python-list mailing list