[Python-Dev] [Python-checkins] peps: PEP 460: add .format_map() (original) (raw)
Eric V. Smith eric at trueblade.com
Thu Jan 9 22:41:55 CET 2014
- Previous message: [Python-Dev] The Great Argument Clinic Conversion Derby is now open!
- Next message: [Python-Dev] [Python-checkins] peps: PEP 460: add .format_map()
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I'm not sure how format_map helps in porting from 2 to 3, since it doesn't exist in any version of 2.
Although that said, it's no doubt a useful feature, just not useful in code that supports both 2 and 3 with a single code base or when porting to 3.
Eric.
On 1/9/2014 4:02 PM, antoine.pitrou wrote:
http://hg.python.org/peps/rev/8947cdc6b22e changeset: 5341:8947cdc6b22e user: Antoine Pitrou <solipsis at pitrou.net> date: Thu Jan 09 22:02:01 2014 +0100 summary: PEP 460: add .formatmap()
files: pep-0460.txt | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-)
diff --git a/pep-0460.txt b/pep-0460.txt --- a/pep-0460.txt +++ b/pep-0460.txt @@ -24,12 +24,16 @@ similar in syntax to
str.format()
(accepting positional as well as keyword arguments). +*bytes.formatmap(...)
andbytearray.formatmap(...)
for an + API similar tostr.formatmap(...)
, with the same formatting + syntax and semantics asbytes.format()
andbytearray.format()
. + Rationale ========= In Python 2,str % args
andstr.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.
Python-checkins mailing list Python-checkins at python.org https://mail.python.org/mailman/listinfo/python-checkins
- Previous message: [Python-Dev] The Great Argument Clinic Conversion Derby is now open!
- Next message: [Python-Dev] [Python-checkins] peps: PEP 460: add .format_map()
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]