PEP 661: Sentinel Values

This should indeed be mentioned in the docs, thanks for catching that. Please send a PR or issue (I’ll try to get to it but might forget).

As for the motivation, subclassing builtins is often somewhat problematic and can lead to confusing behavior. What you mention about module inference is one example. That’s why I preferred to keep the behavior more restricted here for now. That said, this is something we can revisit in the future, and if good use cases emerge we can enable subclassing in 3.16.

4 Likes