On 6 Apr 2006, at 7:02, John J Lee wrote:

> On Thu, 6 Apr 2006, Michael P. Soulier wrote:
> [...]
>> I thought that the distinction was as follows.
>>
>> str() should return a human-readable representation of something.
>>
>> repr() should return a machine-readable representation of  
>> something, suitable
>> for an exec command.
> [...]
>
> Is this old chestnut really still around?  repr() is for debugging; it
> does not have to return an eval()-able string.  The __repr__ docs  
> explain
> that well.

Yes, I find this to be one of the advantages python has over java: In  
python, coercion to string (str) is separate from providing a  
description for debugging (repr).

Until your email, I was starting to think I was unusual in this  
interpretation.

robey

_______________________________________________
Python-3000 mailing list
Python-3000@python.org
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to