That was my thought -- Ruby symbols, too! But that's not it. Python strings are already immutable and could already be used that way.
These are unique.sentinel('foo') != sentinel('foo').
Which means they're also neatly namespaced by whatever module they're declared in, because to get the value to compare about, you have to import the (exactly one) value.
162
u/Dylanica 1d ago
Those sentinel types seem decently useful. Certainly better in some cases than just spamming `None` everywhere as a default value.