A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2010-November/105251.html below:

[Python-Dev] str.format_from_mapping

[Python-Dev] str.format_from_mapping [Python-Dev] str.format_from_mappingEric Smith eric at trueblade.com
Thu Nov 4 01:14:27 CET 2010
On 10/31/10 4:39 PM, Eric Smith wrote:
> What are your thoughts on adding a str.format_from_mapping (or similar
> name, maybe the suggested "format_map") to 3.2? See
> http://bugs.python.org/issue6081 . This method would be similar to
> "%(foo)s %(bar)s" % d, where d is a dict (or rather any mapping object),
> but of course would use str.format syntax: "{foo}
> {bar}".format_from_mapping(d).
>
> I like the idea. It's particularly handy when converting from %-formatting.
>
> Eric.

I've updated the issue with tests, minimal docs, and a name change to 
str.format_map. Having heard no objections and some support, I'll commit 
this shortly.

-- 
Eric.
More information about the Python-Dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4