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

2006-02-17 Thread Steven D'Aprano
On Thu, 16 Feb 2006 08:04:43 -0800, szabi wrote: 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

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

2006-02-16 Thread Heiko Wundram
szabi wrote: a = [1, 2, 3] f(*a, 4) f(*(a+[4])) --- Heiko. -- http://mail.python.org/mailman/listinfo/python-list

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

2006-02-16 Thread Peter Otten
szabi wrote: 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

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

2006-02-16 Thread szabi
The question was perfectly answered by Heiko Wundram: f(*(a+[4])) I know python is not a lawnmower but a programming language. I can solve a lot of problems, but I prefer short, clear and nice solutions to long and/or too powerful ones. So, my problem with my solution (b = list(a); b.append(4))

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

2006-02-16 Thread szabi
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

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

2006-02-16 Thread Paul Rubin
szabi [EMAIL PROTECTED] writes: 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) f(*a+[4]) seems to work. -- http://mail.python.org/mailman/listinfo/python-list