Python 3.15.0 puts sentinel types in the spotlight
A Reddit thread links to the official Python 3.15.0 release page.
R/PROGRAMMING (TOP) — The discussion focuses on sentinel types for APIs that need to distinguish a missing argument from an explicit None value. Commenters call the `unset = object()` workaround clunky and note Enum.NOT_PROVIDED as a typed alternative. Lazy imports also draw praise in the thread.
The new material in the thread is a link to the official Python 3.15.0 page on python.org. The excerpt does not reproduce the release notes.
Comments focus on sentinel types as a way to avoid using None as a default when None itself is a valid argument. This approach replaces ad hoc markers like `unset = object()`. Readers split on readability: Enum.NOT_PROVIDED works with type annotations, yet several commenters find it clunky. Lazy imports also get praise in the thread. A separate remark pictures sentinel values replacing StopIteration for iterators in an alternate design.
Readers’ Forum
No contributions yet — open the debate.
Open the discussion
No account or password needed — just enter your e-mail and we’ll send you a one-time sign-in link. First time here? You’re set up automatically.
Your rating will be applied automatically after you sign in.
Check your inbox
We’ve sent a sign-in link to …. Open it on this device — this tab will sign you in automatically.
Nothing arrived? Check your spam folder — and mark the mail as "Not spam" so it lands in your inbox next time.