<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<br>
<div class="moz-cite-prefix">On 13/11/2012 4:18 PM, Dave Angel
wrote:<br>
</div>
<blockquote cite="mid:50A2B90F.1020303@davea.name" type="cite">
<pre wrap="">On 11/13/2012 03:24 PM, Colin J. Williams wrote:
</pre>
<blockquote type="cite">
<pre wrap=""><SNIP>
I am working on the assumption that the first argument of the format
builtin function and be a sequence of values, which can be selected
with {1:}, {2:}, {0:} etc.
The docs don't make this clear. I would appreciate advice.
</pre>
</blockquote>
<pre wrap="">
The built-in function format():
<a class="moz-txt-link-freetext" href="http://docs.python.org/3.3/library/functions.html?highlight=format%20builtin#format">http://docs.python.org/3.3/library/functions.html?highlight=format%20builtin#format</a>
The first parameter is a single object, NOT a sequence. One object, one
format. If you want more generality, use the str.format() method:
<a class="moz-txt-link-freetext" href="http://docs.python.org/3.3/library/stdtypes.html?highlight=format#str.format">http://docs.python.org/3.3/library/stdtypes.html?highlight=format#str.format</a>
where you can supply a list or a dictionary of multiple items to be
formatted into a single string. That's the one where you supply the
curly braces.
</pre>
</blockquote>
<br>
The docs for the first case leave open the possibility of using a
sequence when they say:<br>
<blockquote>"Convert a <em>value</em> to a “<span
class="highlighted">format</span>ted” representation, as
controlled by
<em><span class="highlighted">format</span>_spec</em>. The
interpretation of <em><span class="highlighted">format</span>_spec</em>
will depend on the type
of the <em>value</em> argument, however there is a standard <span
class="highlighted">format</span>ting syntax that
is used by most built-in types: <a class="reference internal"
href="http://docs.python.org/3.3/library/string.html#formatspec"><em>Format
Specification Mini-Language</em></a>."<br>
</blockquote>
I hope that, as time goes by, consideration will be given to
permitting a sequence. It would appear to be a relatively simple
change. This would extend the generality of the format function.<br>
<br>
Thanks for clarifying this. It confirmed my trial and error
results.<br>
<br>
Colin W.<br>
<br>
<br>
<blockquote cite="mid:50A2B90F.1020303@davea.name" type="cite">
</blockquote>
<br>
</body>
</html>