python-stdlib-sentinels
python-stdlib-sentinels copied to clipboard
Reference implementation of sentinels for the Python stdlib
Sentinels
This is a reference implementation of a utility for the definition of sentinel values in Python. This also includes a draft PEP for the inclusion of this utility in the Python standard library.
Usage
from sentinels import Sentinel
NotGiven = Sentinel('NotGiven')
MEGA = Sentinel('MEGA', repr='<MEGA>', module_name='my_mod')