Message74628
Yes, the default value expression could be evaluated each time the
function is called without the parameter. But it would be another language.
Default values are computed once, and this is a Python feature.
It can be useful, for example to cache computations, or to achieve
"early binding" in nested functions, as explained in the suggested FAQ. |
|
Date |
User |
Action |
Args |
2008-10-10 11:22:26 | amaury.forgeotdarc | set | recipients:
+ amaury.forgeotdarc, eckhardt, trott |
2008-10-10 11:22:26 | amaury.forgeotdarc | set | messageid: <1223637746.17.0.325971672715.issue4098@psf.upfronthosting.co.za> |
2008-10-10 11:21:21 | amaury.forgeotdarc | link | issue4098 messages |
2008-10-10 11:21:20 | amaury.forgeotdarc | create | |
|