flat tuple

John Lenton john at grulic.org.ar
Tue Sep 21 22:11:29 CEST 2004


On Tue, Sep 21, 2004 at 03:26:37PM +0200, Alex Martelli wrote:
> Phil Frost <indigo at bitglue.com> wrote:
> 
> > Tuples can be joined with the + operator, like so:
> > 
> > >>> (1,2)+(3,4)
> > (1, 2, 3, 4)
> > 
> > so in your case, you could do (n,) + t. If you are using the result for
> > % formatting, it might be better to use a list, which is mutable, so
> 
> 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?

-- 
John Lenton (john at grulic.org.ar) -- Random fortune:
Most public domain software is free, at least at first glance.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 196 bytes
Desc: Digital signature
URL: <http://mail.python.org/pipermail/python-list/attachments/20040921/a57fe6a0/attachment.sig>


More information about the Python-list mailing list