https://github.com/python/cpython/commit/2674c322c6cc5a81ce54d807c64cb0e221521786
commit: 2674c322c6cc5a81ce54d807c64cb0e221521786
branch: main
author: Stelar <[email protected]>
committer: JelleZijlstra <[email protected]>
date: 2026-04-28T16:50:53-07:00
summary:

gh-149119: docs: mention that sentinel does not support subclassing (#149120)

Add note about sentinel objects not supporting subclassing

Clarify that sentinel objects do not support subclassing.

files:
M Doc/library/functions.rst

diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst
index aa99d198e436d5..06fd5cdc7be2a6 100644
--- a/Doc/library/functions.rst
+++ b/Doc/library/functions.rst
@@ -1839,6 +1839,8 @@ are always available.  They are listed here in 
alphabetical order.
    Sentinel objects are truthy and compare equal only to themselves.  They are
    intended to be compared with the :keyword:`is` operator.
 
+   ``sentinel`` does not support subclassing.
+
    Shallow and deep copies of a sentinel object return the object itself.
 
    Sentinels are conventionally assigned to a variable with a matching name.

_______________________________________________
Python-checkins mailing list -- [email protected]
To unsubscribe send an email to [email protected]
https://mail.python.org/mailman3//lists/python-checkins.python.org
Member address: [email protected]

Reply via email to