Hacker News new | ask | show | jobs
by bilsbie 1062 days ago
Why does that issue only come up with default arguments?

Why not other places?

1 comments

Default arguments are evaluated and created when the function definition is evaluated, not when the function itself is evaluated. This means that the scope of the default argument is actually the entire module, not just a single invocation of the method. This is what throws people off.