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 _______________________________________________ Python-ideas mailing list -- python-ideas@python.org To unsubscribe send an email to python-ideas-le...@python.org https://mail.python.org/mailman3/lists/python-ideas.python.org/ Message archived at https://mail.python.org/archives/list/python-ideas@python.org/message/KD4K4APZ3RNN47WW5CUBDFYKYGQKRZZV/ Code of Conduct: http://python.org/psf/codeofconduct/