Re: Coming In Python 3.15: Sentinel Values

Tim Daneliuk <[email protected]> Tue, 12 May 2026 09:52:55 -0500
Newsgroups comp.lang.python
Organization A noiseless patient Spider
Message-ID <[email protected]>
On 5/11/26 21:42, Lawrence D’Oliveiro wrote:
> On Mon, 11 May 2026 19:51:21 -0500, Tim Daneliuk wrote:
> 
>> On 5/10/26 19:17, Lawrence D’Oliveiro wrote:
>>>
>>> A new feature coming in Python 3.15 is the “sentinel” class, useful
>>> for creating custom values to mark the end of sequences of items, that
>>> kind of thing
>>> <https://docs.python.org/3.15/library/functions.html#sentinel>,
>>> <https://peps.python.org/pep-0661/>.
>>>
>>> For those times when a simple “None” marker element is not
>>> sufficient, this will be very convenient.
>>
>> Forgive me, but this smells of Feeping Creaturism to solve a not
>> very important question at the expense crufting up the language and
>> decreasing clarity.
> 
> In order to be forgiven, you will have to explain why you think so.
> Some of us have done enough Python programming that we can see the
> utility of such a feature, minor as it is.

I have also done plenty of Python programming (and C, and Fortran, and BASIC, and
many assemblers, and ...).

I stipulate that there is some utility to a sentinel feature.  But it does so at a
cost.  That cost is bloating the language definition with yet another feature that
has fairly limited application beyond what is already possible.

I've seen this happen over and over again in a variety of languages.  "Elegant"
solutions are proposed to legitimate problems but these solutions make the
language bigger, harder to master, and harder to maintain.

True elegance comes from a reduction of complexity and improving regularity while
expanding utility.  It does not come from just gluing on more and more new features.

I don't maintain Python, and the people who do are certainly welcome to add
anything they want.  I simply wanted to observe that - based on past history -
this will eventually lead to a bloated and less usable language.

It's an opinion, not a law of nature ...