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)?