On 14May2021 0622, micro codery wrote:

    There was a discussion a while back ( a year or so?? ) on
    Python-ideas that introduced the idea of having more "sentinel-like"
singletons in Python -- right now, we only have None. Not quite true, we also have Ellipsis, which already has a nice repr that both reads easily and still follows the convention of eval(repr(x)) == x. It also is already safe from instantiation, survives pickle round-trip and is multi-thread safe. So long as you are not dealing with scientific projects, it seems a quick (if dirty) solution to having a sentinel that is not None.

I don't think using "..." to indicate "some currently unknown or unspecified value" is dirty at all, it seems perfectly consistent with how we use it in English (and indexing in scientific projects, for that matter, where it tends to imply "figure out the rest for me").

All that's really missing is some kind of endorsement (from python-dev, presumably in the docs) that it's okay to use it as a default parameter value. I can't think of any reason you'd need to accept Ellipsis as a *specified* value that wouldn't also apply to any other kind of shared sentinel.

Cheers,
Steve
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/VCKTZF45OAFYNIOL5IVNI5HG34BGJBEA/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to