What's wrong?
Stefan Franke
spamfranke at bigfoot.de
Sun Oct 24 08:08:02 EDT 1999
On Sat, 23 Oct 1999 23:06:25 -0700, Fuming Wang
<fuming at venus.radsci.uci.edu> wrote:
>
>Hi, following code snippet gave me a surpise. Could anyone tell me what's
>wrong?
>
This is a FAQ - see http://www.python.org/doc/FAQ.html#6.25
Since function definitions in Python are statements, which are
executed by your scripts, the list object in your default argument -
list=[] - is created only once, and then shared between all instances.
>Thanks!
>Fuming Wang
You're welcome!
Stefan
More information about the Python-list
mailing list