[Python-3000] PEP 3138- String representation in Python 3000
Oleg Broytmann
phd at phd.pp.ru
Tue May 27 01:03:30 CEST 2008
On Mon, May 26, 2008 at 06:53:41PM -0400, Jim Jewett wrote:
> On 5/24/08, Oleg Broytmann <phd at phd.pp.ru> wrote:
> > On Sat, May 24, 2008 at 12:53:08PM -0400, Jim Jewett wrote:
> > > if I want pretty, I'll use print (or pprint).
>
> > str(container_of_strings) uses repr(), so you loose prettiness on either
> > print or '%s' % container_of_strings.
>
> This is not a problem with repr; it is a bug with str.
str(container) tries to call container.__str__ (which is absent) and
then container.__repr__. Is "str or repr" a bug?
Oleg.
--
Oleg Broytmann http://phd.pp.ru/ phd at phd.pp.ru
Programmers don't die, they just GOSUB without RETURN.
More information about the Python-3000
mailing list