Programming · by Playa Cambiante · 2026-10-31
Much ado about None: sentinel values in Python
Nice write up on why None isn't always the right default, when you need a sentinel object, and the patterns people use (object(), enums, dedicated classes) along with their tradeoffs for typing and pickling.
What's your go-to sentinel pattern?
What's your go-to sentinel pattern?
20 sparks · 3 comments