default values of function parameters

David Isaac aisaac0 at
Mon Jun 6 05:20:53 CEST 2005

Alan Isaac wrote:
> Default parameter values are
> evaluated once when the function definition is
> executed. Where are they stored? ... Where is this documented?

Forgive any poor phrasing: I'm not a computer science type.
At we read:
"The execution of a function introduces a new symbol table
used for the local variables of the function. More precisely,
all variable assignments in a function store the value in the local
symbol table; whereas variable references first look in the local
symbol table, then in the global symbol table, and then in the table of
built-in names."

But the default values of function parameters seem rather like a static
attributes of a class.
Is that a good way to think of them?
If so, are they somehow accessible?
How? Under what name?

Alan Isaac

More information about the Python-list mailing list