On 26/05/2020 05:03, David Mertz wrote:
On Mon, May 25, 2020, 11:56 PM Christopher Barker
well, yes and no. this conversation was in the context of "None"
works fine most of the time.
How many functions take None as a non-sentinel value?! How many of
that tiny numbers do so only because they are poorly designed.
None already is an excellent sentinel. We really don't need others. In
the rare case where we really need to distinguish None from "some
other sentinel" we should create our own special one.
The only functions I can think of where None is appropriately
non-sentinel are print(), id(), type(), and maybe a couple other
oddball special ones.
Seriously, can you name a function from the standard library or
another popular library where None doesn't have a sentinel role as a
function argument (default or not)?
str(), repr(), ascii(). bool(), callable(), dir(), format(), hash(),
help(), isinstance(None, ...)
_______________________________________________
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/HRHERKG7LQABU6C3CCQ4ASRAX4NLRTAP/
Code of Conduct: http://python.org/psf/codeofconduct/
_______________________________________________
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/BLFXFVKW7H7S32IISHYL33KRKSAKDJ2N/
Code of Conduct: http://python.org/psf/codeofconduct/