[$] Late-bound argument defaults for Python

Post Syndicated from original https://lwn.net/Articles/875441/rss

Python supports default values for arguments to functions, but those
defaults are evaluated at function-definition time. A proposal to add
defaults that are evaluated when the function is called has been discussed
at some length on the python-ideas mailing list. The idea came about, in part,
due to yet another resurrection of the proposal
for None-aware operators
in Python. Late-bound defaults would help
with one use case for those operators, but there are other, stronger
reasons to consider their addition to the language.