On Tue, Apr 15, 2008 at 10:30 PM, Greg Ewing
<[EMAIL PROTECTED]> wrote:
> Terry Reedy wrote:
>  > import unirep
>  > print(*map(unirep.russian, objects))
>
>  That's okay if the objects are strings, but what about
>  non-string objects that contain strings?
>
>  We'd need another protocol, such as __unirep__.

Or have str.__repr__() respect per-thread settings, the way decimal
arithmetic does.

Default settings would be in force most of the time; the interactive
prompt would apply the user's settings when repr-ing a result.  This
approach solves the nested-strings problem quite nicely.  But it does
not catch error/warning/log messages when they are generated, unless
the program does *everything* under custom repr settings (dangerous).

There really are two use cases here: a human-readable repr for
error/warning/log messages; and a machine-readable, always-the-same,
ASCII-only repr.  Users want to be able to tweak the former.

-j
_______________________________________________
Python-3000 mailing list
Python-3000@python.org
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to