Version-Specific Features
Python 3.15 — Named sentinel values
Create an identity-based marker to distinguish a missing argument from an explicit None. Sentinels preserve identity under copying; pickling requires a suitably importable module binding. Compare with is rather than truthiness. Requires Python 3.15 or the relevant build; example is not executed locally.
Formal Syntax & Structure
python syntaxpython
sentinel(name)Return Value
Feature-specific
No single return type; see the example and feature description.
Working Example
Example Snippetpython
from copy import copyMISSING = sentinel('MISSING')print(copy(MISSING) is MISSING)print(MISSING is None)