On May 14, 2021, at 02:38, Chris Angelico <[email protected]> wrote: > > Do we ever really need the ability to pass a specific sentinel to a > function, or are we actually looking for a way to say "and don't pass > this argument”?
Very often, that’s the case. Such a “it’s okay to not pass this argument”
construct would have to work with the Optional type too.
The other use case I have for a special case single use singleton is for
dict.get(), i.e.
missing = object()
value = somedict.get(‘key’, missing)
if value is missing:
# It ain’t there.
-Barry
signature.asc
Description: Message signed with OpenPGP
_______________________________________________ Python-Dev mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3/lists/python-dev.python.org/ Message archived at https://mail.python.org/archives/list/[email protected]/message/2VTKCFCR6PPMS5ZYUYM3SF2BVFQYMSSE/ Code of Conduct: http://python.org/psf/codeofconduct/
