[Python-3000] PEP 3138- String representation in Python 3000

Jim Jewett jimjjewett at gmail.com
Sat May 24 18:53:08 CEST 2008


On 5/24/08, Stephen J. Turnbull <stephen at xemacs.org> wrote:
> Atsuo Ishimoto writes:

>   > Yes. My question is "Which do you feel comfortable, printing collect
>   > glyphs or hex-escaped ASCII ?". I prefer printed glyphs for foreign
>   > characters, but I had feeling that western people prefer hex-escaped
>   > ASCII in general. But from responses I saw, perhaps this is not big
>   > deal.

It depends on why I'm looking at it.  I do prefer hex for repr,
because hex is safer; if I want pretty, I'll use print (or pprint).

> I think Americans, at least, tend to fear that non-ASCII will be
>  interpreted as terminal control sequences or highlighted annoyingly in
>  some way.

Because it often is, even on systems that can display the proper
glyphs in other contexts -- and it isn't always possible to recover
from a messed-up terminal without restarting the session.  I'll grant
that this implies bugs in the programs I use -- but they happen enough
with enough different programs that it is a concern.

>  Otherwise, they might grumble about the fact that what
>  they're seeing isn't English, but it doesn't matter whether it's
>  hex-escaped or kanji.

I'm more worried that it might look like English, yet be subtly (and
importantly) different.  I can distinguish the characters in ASCII
pretty well, or at least recognize when something looks ambiguous.  I
cannot do that so well with other scripts -- but seeing a hex escape
warns me that something special is happening.

Note that I have no objection to properly displaying other characters
as a system-wide setting.  I'm glad that it is easy to do with print.

I just want it to be very easy to say "on my system, repr is ASCII".
I would prefer that ASCII also be the default, so that people who want
more characters opt in to receive them, at least once at installation
time.

-jJ


More information about the Python-3000 mailing list