
On Thu, May 13, 2021 at 10:31 PM Christopher Barker <pythonchb@gmail.com> 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.
As I remember, the year-ago conversation was basically wanting more ways of saying "argument not specified" in function signatures. The thought was that None is used pretty often to mean something somewhat different. The rough consensus seemed to be that `my_sentinel = object()` was a low burden per project. But in what I recall, there was no talk there of custom behavior like a nicer repr(). My own feeling is that ONLY a repr() isn't quite enough to motivate an addition to stdlib. But if there were a few other useful behaviors, maybe it would be (e.g. maybe default or specifiable inequality operations). However, I wouldn't really want another two or three or four singletons, but rather a slightly more templated factory than just `object()`. -- The dead increasingly dominate and strangle both the living and the not-yet born. Vampiric capital and undead corporate persons abuse the lives and control the thoughts of homo faber. Ideas, once born, become abortifacients against new conceptions.