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

Cameron Simpson cs at zip.com.au
Sun Feb 23 04:47:17 CET 2014

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.

It might be inferred from the earlier context, but I do not think
it can be deduced and therefore I think it should be said outright.
All the other formatting codes are quite explicit about how their
arguments transform into bytes, but the numeric codes just quietly
assume ASCII. The PEP should be blatant.

Otherwise I think the PEP is clear and reasonable.

Cameron Simpson <cs at zip.com.au>

ASCII  n s. [from the greek]  Those people who, at certain times of the year,
have no shadow at noon; such are the inhabitatants of the torrid zone.
        - 1837 copy of Johnson's Dictionary

More information about the Python-Dev mailing list