Array of dict or lists or ....?

Gabriel Genellina gagsl-py2 at yahoo.com.ar
Tue Oct 7 03:15:35 EDT 2008


En Mon, 06 Oct 2008 22:52:29 -0300, Tim Chase  
<python.list at tim.thechases.com> escribió:

>>>    __repr__ = __str__

[bearophileHUGS at lycos.com wrote]
>>  I don't know if that's a good practice.

> I've seen it in a couple places, and it's pretty explicit what it's  
> doing.

__repr__ is used as a fallback for __str__, so just defining __repr__ (and  
leaving out __str__) is enough.

-- 
Gabriel Genellina




More information about the Python-list mailing list