evaluated function defaults: stored where?

Raymond Hettinger python at rcn.com
Thu May 26 01:05:25 EDT 2005


[Alan Isaac]
> Default parameter values are evaluated once when the function definition is
> executed.  Where are they stored?


>>> def f(a, b=10, c=20):
.       pass
>>> f.func_defaults
(10, 20)


> Where is this documented?

http://docs.python.org/ref/types.html#l2h-78



Raymond Hettinger




More information about the Python-list mailing list