[Python-3000] Recursive str

Antoine Pitrou solipsis at pitrou.net
Sun Apr 13 16:10:40 CEST 2008


Greg Ewing <greg.ewing <at> canterbury.ac.nz> writes:
> 
> It might not be a serious problem when most of the chars in
> the string are ascii, but what about e.g. a Japanese user
> whose strings consist almost entirely of non-ascii, but are
> for the most part what constitutes perfectly readable text
> to them? They will have no straightforward way to display
> a list of strings in a readable form.

How about print ",".join(mylist) ?

> I'm not sure what to do about that, though. Maybe some
> sort of locale setting that makes repr() of a string not
> escape chars that fall into some kind of "normal" set
> according to the user's native language?

If it's only a problem with the interactive interpreter, perhaps it's just a
matter of converting back \uXXXX and \xYY codes if possible (according to the
detected terminal encoding) when outputting the result of an expression?




More information about the Python-3000 mailing list