[Python-3000] PEP 3138- String representation in Python 3000
Oleg Broytmann
phd at phd.pp.ru
Sat May 24 19:27:21 CEST 2008
On Sat, May 24, 2008 at 09:18:14PM +0400, Oleg Broytmann 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. Exceptions use repr() for file names,
> e.g., which is very inconvenient, IMHO.
I meant - you cannot print() an exception to make it pretty - it uses
repr() internally anyway. The only way to win back the prettiness is to
make repr() prints printable strings without encoding.
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