Showing content from http://mail.python.org/pipermail/python-dev/attachments/20101031/eb3a67ca/attachment.html below:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#330033" bgcolor="#ffffff">
On 10/31/2010 2:02 PM, Benjamin Peterson wrote:
<blockquote
cite="mid:AANLkTikqL612PJiAoPssfukqHGOh=FRMEK_DwSbtSEk+@mail.gmail.com"
type="cite">
<pre wrap="">2010/10/31 Antoine Pitrou <a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="mailto:solipsis@pitrou.net"><solipsis@pitrou.net></a>:
</pre>
<blockquote type="cite" style="color: rgb(0, 0, 0);">
<pre wrap=""><span class="moz-txt-citetags">> </span>On Sun, 31 Oct 2010 16:39:44 -0400
<span class="moz-txt-citetags">> </span>Eric Smith <a moz-do-not-send="true" class="moz-txt-link-rfc2396E" href="mailto:eric@trueblade.com"><eric@trueblade.com></a> wrote:
<span class="moz-txt-citetags">></span>
</pre>
<blockquote type="cite" style="color: rgb(0, 0, 0);">
<pre wrap=""><span class="moz-txt-citetags">>> </span>What are your thoughts on adding a str.format_from_mapping (or similar
<span class="moz-txt-citetags">>> </span>name, maybe the suggested "format_map") to 3.2? See
<span class="moz-txt-citetags">>> </span><a moz-do-not-send="true" class="moz-txt-link-freetext" href="http://bugs.python.org/issue6081">http://bugs.python.org/issue6081</a> . This method would be similar to
<span class="moz-txt-citetags">>> </span>"%(foo)s %(bar)s" % d, where d is a dict (or rather any mapping object),
<span class="moz-txt-citetags">>> </span>but of course would use str.format syntax: "{foo}
<span class="moz-txt-citetags">>> </span>{bar}".format_from_mapping(d).
</pre>
</blockquote>
<pre wrap=""><span class="moz-txt-citetags">></span>
<span class="moz-txt-citetags">> </span>I must be missing something, but what's the difference with
<span class="moz-txt-citetags">> </span>XXX.format(**d)?
</pre>
</blockquote>
<pre wrap="">It allows arbitrary mappings.
</pre>
</blockquote>
<br>
Other than the language moratorium, why are arbitrary mappings not
allowed for the (**d) syntax?<br>
</body>
</html>
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