initialization in argument definitions

John Machin sjmachin at lexicon.net
Fri Nov 21 16:42:33 EST 2008


On Nov 22, 8:25 am, Brentt <BrenttNew... at gmail.com> wrote:
> Hi, I know this is a terribly simple question, but the docs seem to be
> designed for people who probably find a the answer to this question
> terribly obvious. But its not at all obvious to me.
>
> I can't figure out why when I define a function, a variable
> (specifically a list) that I define and initialize in the argument
> definitions, will not initialize itself every time its called.

Have you worked through the tutorial (which is part of the docs)? See
http://docs.python.org/tutorial/controlflow.html#default-argument-values
... look for "Important warning"




More information about the Python-list mailing list