[Python-3000] Recursive str

atsuo ishimoto ishimoto at gembook.org
Wed Apr 16 02:26:40 CEST 2008


2008/4/16, Terry Reedy <tjreedy at udel.edu>:
>  I suspect the real solution has to be language-community (and even
>  programmer) specific, since I expect most people would like the chars they
>  know and expect to be unescaped and others left escaped.  So, perhaps there
>  should be a unirep module, stdlib or not, used like:
>
>  import unirep
>  print(*map(unirep.russian, objects))

But how to implement unirep.russian()? Printing string is not a
problem, but what annoy me is printing list, tuple or other instances.
To implement such language-specific repr(), it should  know how to
build a repr()ed string of all types.

Another idea is supplying a language parameter to PyObject_Repr() and
let each type call language-specific string convert function, but I
think it's excess.


More information about the Python-3000 mailing list