PyCon DE & PyData 2026

Florian Wilhelm

Florian is Head of Data Science & Mathematical Modeling at inovex GmbH, an IT project center driven by innovation and quality, focusing its services on ‘Digital Transformation’. He holds a PhD in mathematics, has more than 10 years of experience in predictive & prescriptive analytics use-cases and likes everything math 🤯


Session

04-14
11:45
30min
Sentinel Values in Python: Semantics, Double Dispatch, and the Limits of Typing
Florian Wilhelm

Python relies heavily on special values such as None, NotImplemented, Ellipsis, and dataclasses.MISSING. These values are not incidental: they encode language semantics, enable control flow between objects, and shape API design.

This talk examines sentinel values as a first-class concept in Python. We will look at why None is often the wrong representation for absence, how NotImplemented enables double dispatch in rich comparisons, and where sentinel values appear throughout the standard library.

A central focus is typing. While sentinel values are ubiquitous at runtime, Python currently has no standardized way to express them precisely in type hints. We will examine why Optional, overloads, and Literal fall short, what limited narrowing is possible today, and why creating a “real” custom sentinel with reliable type narrowing is still unsolved.

Finally, we will discuss PEP 661, i.e., the deferred proposal to standardize sentinel values and their typing semantics, and what its deferral means in practice. Using real-world examples, including Pydantic’s experimental missing concept, this talk provides a clear mental model for sentinel values and realistic guidance for using them in typed Python codebases today.

PyCon: Programming & Software Engineering & Testing
Merck Plenary (Spectrum) [1st Floor]