
On 2021-10-25 18:56, Steven D'Aprano wrote:
Modifying the assignment symbol is wrong. This is not a new kind of assignment, it should use the same `=` regular assignment. We are tagging the parameter to use late-binding, not using a different sort of assignment. The tag should be on the parameter name, not the assignment.
I agree with half of this :-). I agree that it's not a new kind of assignment. But I don't think we're tagging the parameter to use late binding. We're tagging the default value itself to not be evaluated right now (i.e., at function definition time) but later (at call time). To me this is another thing that suggests a more general deferred-evaluation system is the best way to handle this. If we're tagging the parameter to not be evaluated "right now", why must we restrict "right now" to be "the time when we're defining a function" and restrict this to apply to function parameters rather than, well, anything? Why not just say we can tag stuff as not being evaluated right now and then later evaluate it? -- Brendan Barnwell "Do not follow where the path may lead. Go, instead, where there is no path, and leave a trail." --author unknown