(original) (raw)

changeset: 5341:8947cdc6b22e user: Antoine Pitrou solipsis@pitrou.net date: Thu Jan 09 22:02:01 2014 +0100 files: pep-0460.txt description: PEP 460: add .format_map() diff -r 286d2a6182dd -r 8947cdc6b22e pep-0460.txt --- a/pep-0460.txt Thu Jan 09 00:14:57 2014 +0100 +++ b/pep-0460.txt Thu Jan 09 22:02:01 2014 +0100 @@ -24,12 +24,16 @@ similar in syntax to ``str.format()`` (accepting positional as well as keyword arguments). +* ``bytes.format_map(...)`` and ``bytearray.format_map(...)`` for an + API similar to ``str.format_map(...)``, with the same formatting + syntax and semantics as ``bytes.format()`` and ``bytearray.format()``. + Rationale ========= In Python 2, ``str % args`` and ``str.format(args)`` allow the formatting -and interpolation of bytes strings. This feature has commonly been used +and interpolation of bytestrings. This feature has commonly been used for the assembling of protocol messages when protocols are known to use a fixed encoding. /solipsis@pitrou.net