__str__ vs. __repr__

Mikael Olofsson mikael at isy.liu.se
Wed Nov 10 02:04:37 EST 1999


On 10-Nov-99 Tim Peters wrote:
 >  No, in that case it would have been named __representation__.  __repr__ is
 >  actually an acronym, meaning Regular-Expression Parsable Rendition.
 >  Similarly __str__ is short for Simpler Than Repr.  I never learned what
 >  __init__ stands for -- it never interested Tim <wink>.

My God! I thought this language was supposed to be easy to handle, to
understand, and to explain. If __repr__ has nothing to do with 
representation and if __str__ has nothing to do with string, I guess
__init__ has nothing to do with initialization. That's not data 
compression; that's information hiding!

someone-should-be-programming-intercal-instead-ly y'rs
 
/Mikael

-----------------------------------------------------------------------
E-Mail:  Mikael Olofsson <mikael at isy.liu.se>
WWW:     http://www.dtr.isy.liu.se/dtr/staff/mikael
Phone:   +46 - (0)13 - 28 1343
Telefax: +46 - (0)13 - 28 1339
Date:    10-Nov-99
Time:    08:58:29

This message was sent by XF-Mail.
-----------------------------------------------------------------------




More information about the Python-list mailing list