[Python-3000] Recursive str
Greg Ewing
greg.ewing at canterbury.ac.nz
Fri Apr 18 00:25:51 CEST 2008
Oleg Broytmann wrote:
> When I use str(container) instead of repr(comtainer) does Python need to
> guess if I want an unambiguous representation or a printable representation
> of items? I don't think there is a room for guessing - I explicitly said
> str().
But there's no single, obvious way of doing str() on a list
that will suit all situations. So Python doesn't define
str() for a list *at all*. You're getting the fallback,
which is repr().
--
Greg
More information about the Python-3000
mailing list