
Dec. 6, 2021
11:32 a.m.
On Mon, Dec 06, 2021 at 10:20:23PM +1100, Chris Angelico wrote:
The reason I consider this to be an independent proposal, and NOT a mechanism for late-bound defaults, is this problem:
def f(lst, n=>len(lst)): lst.append(1) print(n)
f([10, 20, 30])
A late-bound default should print 3. A deferred expression should print 4.
Not according to R's model for late-bound default values, which are performed at need. "Late evaluation of defaults" can cover a lot of different semantics. We can choose which semantics we want. -- Steve