PEP 661: Sentinel Values

If subclassing is not something that is entirely out of the world, could we have a PySentinel_CheckExact() alias for PySentinel_Check() (or, rather, the other way round) already in Py3.15, so that users can make the distinction in their code already? Even if both do the same thing for the time being, I don’t see why we should let users pile up code on their side that turns out to be incorrect and needs to be changed if subclassing gets allowed at some point in the future.

4 Likes