Re: scope of optional arguments

2008-05-19 Thread cseja
Thank you very much for your fast and usefull response, Steven. Have a nice day. -- http://mail.python.org/mailman/listinfo/python-list

Re: scope of optional arguments

2008-05-19 Thread cseja
Whoops, I meant to call print walk([1,2,3], []) print walk([4,5,6]) and print walk([1,2,3]) print walk([4,5,6]) with def walk(seq, result = []): for item in seq: result.append(item) return result The question is still the same: Why do both calls give different results? Thank you very

Re: scope of optional arguments

2008-05-19 Thread Steven Clark
http://www.ferg.org/projects/python_gotchas.html#contents_item_6 On Mon, May 19, 2008 at 10:30 AM, cseja <[EMAIL PROTECTED]> wrote: > If I call > > print walk([1,2,3], []) > print walk([5,6,7]) > > I get > > [1, 2, 3] > [4, 5, 6] > > but when I call > > print walk([1,2,3]) > print walk([5,6,7]) >