pythonic way of 'b = list(a); b.append(4)"

szabi szabolcs.berecz at gmail.com
Thu Feb 16 11:04:43 EST 2006


Hi!

I have a list of three values and want to call a function with four
parameters. I would like
to write something like:

a = [1, 2, 3]
f(*a, 4)

This is syntactically wrong, so is there a function which appends a
value to a list and
returns the new value, so that I could write something like this:

f(list(a).functional_append(4))

I can't modify 'a'.

Thanks,
Szabi




More information about the Python-list mailing list