
Aug. 31, 2023
11:05 a.m.
On Thu, 31 Aug 2023 at 18:55, Tim Hoffmann via Python-ideas <python-ideas@python.org> wrote:
The standard pattern to create a sentinel in Python is
Unset = object()
While this is often good enough, it has some shortcomings:
- repr(Unset) is unhelpful: <object at 0x1ded9911b60>
Looks like you may be thinking of this: https://peps.python.org/pep-0661/ There are a few options here, including classes, enums, and a dedicated sentinel type. ChrisA