Stephen J. Turnbull wrote:
Nick Coghlan writes:
> Martin v. Löwis wrote:
> >> Is new built-in function desirable, or just document is good enough?
> >
> > Traditionally, I take the position that new built-in functions are
> > rarely desirable; this one is no exception.
>
> I agree with that, but string.repr_ascii may be a reasonable thing to add.
But this is basically completely a codec issue. We have an internal
representation, and we want to translate it in a stream-oriented way
to an external representation. Unless there's an efficiency issue,
why not just provide a hook for a codec?
It would just be a convenience function to do a string to string
conversion in code. I agree for an actual output stream you could just
set the encoding to ASCII with backslashreplace error handling.
Cheers,
Nick.
--
Nick Coghlan | [EMAIL PROTECTED] | Brisbane, Australia
---------------------------------------------------------------
http://www.boredomandlaziness.org
_______________________________________________
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