23 Jul
2018
23 Jul
'18
12:51 a.m.
On Sun, Jul 22, 2018 at 11:26:15PM +1000, Chris Angelico wrote:
You forget that the operator will *short-circuit*. It will not evaluate the second argument if the first argument is None. You cannot do this with a function, other than with a hack like a lambda function.
We keep running up to this issue. What if there was a language supported, non-hackish way to officially delay evaluation of expressions until explicitly requested? That would allow us to write a function: func(arg, default = delayed-expression) and avoid new punctuation. Then the only bike-shedding will be where the function should live and what it is called and how many arguments it ought to take... -- Steve