Home

On Aug 6, 6:25 am, Neil Cerutti <horp...@yahoo.com> wrote:
Because when the function is called, the line


> if y is None: y = []


is executed, binding a brand new empty list to y. This
"rebinding" happens every time the function is called, unless you
provide an argument for y that is not None.

Thanks for the prompt replies. But I am still confused. This is what
confuses me....
The first time you call the function, say with f(23), after the
function ends,
y no longer equals None. Therefore, calling f again, this time like
this f(24),
should make y equal [23,24], because the 'if y == None' test fails, or
at least I think it
fails, because y.append(x) added something that was not equal to None
during the previous call.

Please help me!

previous
next

Re: Limits on search length
Re: python 2.5 bug
Re: A few questions on C++
Re: trap setting attribute when the attribute is dict
Re: Question about objects
kołdra sklep internetowy
Dekoracje okien
www.bwin.com
pozycjonowanie
Szkoła policealna technik bhp warszawa