flat tuple

Peter Hansen peter at engcorp.com
Tue Sep 21 16:15:00 EDT 2004


John Lenton wrote:
> On Tue, Sep 21, 2004 at 03:26:37PM +0200, Alex Martelli wrote:
>>Might be, but % wants a tuple as the RHS (assuming the LHS format string
>>has multiple %-formatting elements), NOT a list.
> 
> you mean it actually converts it into a tuple?

This isn't that hard to test:

c:\>python
 >>> 'testing %s %s' % ['use of', 'a list']
Traceback (most recent call last):
   File "<stdin>", line 1, in ?
TypeError: not enough arguments for format string

-Peter



More information about the Python-list mailing list