taleinat / python-stdlib-sentinels

Reference implementation of sentinels for the Python stdlib

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

instead of hacking the class into globals, ensure that reduce/picling can restore the object

RonnyPfannschmidt opened this issue · comments

if the sentinel type was simply available on the sentinel, that would be good enough for a number of cases

MyMissing = sentinel("missing", module=__name__)
assert isinstance(MyMissing, MyMissing.type

pickle could aslo be set up to just return them as the value stored in the module

Thanks for the suggestions!

I played around with such options... too much. In the end I've simply foregone the dedicated classes entirely, using a single Sentinel class.