str() of a tuple

Donn Cave donn at
Thu Sep 5 15:48:50 EDT 2002

Quoth "Fredrik Lundh" <fredrik at>:
| Douglas Zongker wrote:
|> Why, oh why does the str() of a container use the repr()s of the
|> objects inside?  This seems to violate what the docs claim str() does
|> -- "return a nicely printable representation of an object."
| "an object" refers to the container itself, not the objects
| in the container.

And the expression "nicely printable" is so ambiguous that it can
mean whatever you like.  I like to define it as what str() does,
which automatically resolves any question about whether str could
be violating this provision.

	Donn Cave, donn at

More information about the Python-list mailing list