J
Julien Sagnard
Hi all,
When passing a list as default argument for a function, only one list is
created for all calls.
exemple:
.... print a
....
I'm not found any reference of this. Is it a bug ?
I'm working on Windows 2000 with python 2.3.4
When passing a list as default argument for a function, only one list is
created for all calls.
exemple:
.... a.append("x")>>> def f(a=[]):
.... print a
....
>>> f() ['x']
>>> f() ['x', 'x']
>>> f() ['x', 'x', 'x']
>>> f() ['x', 'x', 'x', 'x']
>>>
I'm not found any reference of this. Is it a bug ?
I'm working on Windows 2000 with python 2.3.4