On 02.03.17 10:36, M.-A. Lemburg wrote:
Why a new syntax ? Can't we just have a pre-defined sentinel
singleton NoDefault and use that throughout the code (and also
special case it in argument parsing/handling)?
def get(store, key, default=NoDefault):
if store.exists(key):
return store.retrieve(key)
...
This means adding a new syntax. NoDefault should be a keyword (we can
reuse existing keyword couldn't be used in expression), and it should be
accepted only in the specific context of declaring function parameter.
_______________________________________________
Python-ideas mailing list
Python-ideas@python.org
https://mail.python.org/mailman/listinfo/python-ideas
Code of Conduct: http://python.org/psf/codeofconduct/