Re: [Python-Dev] PEP 461: Adding % formatting to bytes and bytearray -- Final, Take 2

2014年2月25日 21:02:25 -0800

On 26 February 2014 13:57, Stephen J. Turnbull <[email protected]> wrote:
> Nick Coghlan writes that b'%a' is
>
> > the obvious way to interpolate representations of arbitrary objects
> > into binary formats that contain ASCII compatible segments.
>
> The only argument that I have sympathy for is
>
> > %a *should* be allowed for consistency with text interpolation
>
> although introduction of a new format character is a poor man's
> consistency, and this is consistency for consistency's sake. (I don't
> have a big problem with that, though. I *like* consistency!)
It's *not* a new format character, unless you mean "new in Python 3".
Python 3 text interpolation has included %a for as long as I can
recall, specifically as a way of spelling the old Python 2 %r
interpolation behaviour now that the Python 3 %r allows Unicode text.
Cheers,
Nick.
-- 
Nick Coghlan | [email protected] | Brisbane, Australia
_______________________________________________
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to