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

Antoine Pitrou solipsis at pitrou.net
Sun Feb 23 12:31:54 CET 2014


On Sat, 22 Feb 2014 20:48:04 -0800
Ethan Furman <ethan at stoneleaf.us> wrote:

> On 02/22/2014 07:47 PM, Cameron Simpson wrote:
> > On 22Feb2014 17:56, Ethan Furman <ethan at stoneleaf.us> wrote:
> >> Please let me know if anything else needs tweaking.
> >> [...]
> >> This area of programming is characterized by a mixture of binary data and
> >> ASCII compatible segments of text (aka ASCII-encoded text).
> >> [...]
> >> %-interpolation
> >>
> >> All the numeric formatting codes (such as ``%x``, ``%o``, ``%e``, ``%f``,
> >> ``%g``, etc.) will be supported, and will work as they do for str, including
> >> the padding, justification and other related modifiers.
> >
> > I would like a single sentence here clarifying that the formatting
> > of numeric values uses an ASCII encoding.
> 
> How's this?
> 
> All the numeric formatting codes (such as ``%x``, ``%o``, ``%e``, ``%f``,
> ``%g``, etc.) will be supported, and will work as they do for str, including
> the padding, justification and other related modifiers.  The only difference
> will be that the results from these codes will be ASCII-encoded bytes, not
> unicode.

You can't encode bytes, so it should be "ASCII-encoded text" ;-)

Regards

Antoine.




More information about the Python-Dev mailing list