3 ms·
What you want is for an assignment in a function definition to be a lambda. def foo (self, arg=lambda : expression): Assignment of unevaluated expressions i
by 1718627440 8mo ago
What you want is for an assignment in a function definition to be a lambda.
def foo (self, arg=lambda : expression):
Assignment of unevaluated expressions is not a thing yet in Python and would be really surprising. If you really want that, that is what you get with a lambda.
> most languages with closures and default values for arguments do it this way.
Do these also evaluate function definitions at runtime?
- codesnik 8mo agoyes they do. check ruby for example.