Re:Common Python Mistakes
by kghose on Thursday May 08, 2014 @11:24AM
(#7715766)
So, not quite module load time, but evaluation time.
[ Parent
| on HN ]
Re:Common Python Mistakes
by marcosdumay on Thursday May 08, 2014 @11:40AM
(#7715856)
Kilink's comment apply again.
If you define several functions at different times, the default argument will be evaluated each time you define a new function. You'll have the same behaviour if you keep reassigning lambdas at the same function name, or if you keep edditing the globals.
You are misunderstanding how dynamic Python is. And, yes, the part about "module load time" was a simplification.