From 7ae0cfa9a3a31880ff6093d67bd78efe9577a0fe Mon Sep 17 00:00:00 2001 From: Antoine Pitrou Date: Thu, 9 Jan 2014 22:02:01 +0100 Subject: [PATCH] PEP 460: add .format_map() --- pep-0460.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pep-0460.txt b/pep-0460.txt index 11b93dc6c..b3c9aecad 100644 --- a/pep-0460.txt +++ b/pep-0460.txt @@ -24,12 +24,16 @@ bytearray objects. The proposed additions are: 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.