Am 17.10.21 um 11:24 schrieb Tal Einat:
Hi typing folks,
I'm continuing to pursue adding a tool for defining sentinel values to the standard library. See PEP 616 [1], previous discussion [2] and previous thread on this mailing list [3], for more background and details.
The gist of the proposal is to add a function or class, e.g. Sentinel(), for defining sentinels in a standard way, providing nice properties such as clear reprs, support for strict type signatures and surviving copying/unpickling.
Without going into implementation details, I would also like to echo that I don't like the Literal syntax. This seems like unnecessary visual noise. Literal was necessary for strings due to the ambiguous nature of quoted annotation and was extended to other literals for consistency. I don't think either of these arguments are applicable for sentinel values. - Sebastian