On 03/27/2014 04:24 AM, Antoine Pitrou wrote:
On Tue, 25 Mar 2014 15:37:11 -0700 Ethan Furman wrote:
``%a`` will call ``ascii()`` on the interpolated value. This is intended
as a debugging aid, rather than something that should be used in production.
Non-ASCII values will be encoded to either ``\xnn`` or ``\unnnn``
representation. Use cases include developing a new protocol and writing
landmarks into the stream; debugging data going into an existing protocol
to see if the problem is the protocol itself or bad data; a fall-back for a
serialization format; or even a rudimentary serialization format when
defining ``__bytes__`` would not be appropriate [8].
The "use cases" you are enumerating for "%a" are chimeric.
Cool word! Haven't seen it a long time. :)
Did you *actually* do those things in real life, or are you inventing them
for the PEP?
The examples came from Jim Jewett, but I can easily see myself using them.
--
~Ethan~
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com