I wish that [].append(x) returned [x]

Paul McGuire ptmcg at austin.rr.com
Tue May 1 17:00:11 EDT 2007


On May 1, 3:45 pm, Tobiah <t... at tobiah.org> wrote:
> I wanted to do:
>
>         query = "query text" % tuple(rec[1:-1].append(extra))
>
> but the append() method returns none, so I did this:
>
>         fields = rec[1:-1]
>         fields.append(extra)
>         query = "query text" % tuple(fields)
>
> --
> Posted via a free Usenet account fromhttp://www.teranews.com

query = "query text" % tuple(rec[1:-1] + [extra])

should work.

-- Paul




More information about the Python-list mailing list