News for hackers. Stuff that matters.
Re:Glom – Restructured Data for Python by nerdponx on Thursday May 10, 2018 @08:41AM (#17038289)
A Sentinel is guaranteed unique and distinct from all other objects.
Re:Glom – Restructured Data for Python by Sean1708 on Thursday May 10, 2018 @09:55AM (#17038860)
I'm fairly sure object() also returns an object which is unique and distinct from all other objects. The only difference as far as I can see is that make_sentinel returns an object that has a unique and distinct type from all other objects, but I don't see why you'd be checking the type of your sentinels in Python.
Re:Glom – Restructured Data for Python by mhashemi on Thursday May 10, 2018 @06:40PM (#17043540)
Hehe, boltons.typeutils.make_sentinel should really be documented better for more experienced developers. A few small advantages: a nice repr, pickleability, and (back to the first advantage really) good rendering in a Sphinx autodoc context. :)