]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-149119: docs: mention that sentinel does not support subclassing (#149120) main
authorStelar <90330577+StelarDream@users.noreply.github.com>
Tue, 28 Apr 2026 23:50:53 +0000 (01:50 +0200)
committerGitHub <noreply@github.com>
Tue, 28 Apr 2026 23:50:53 +0000 (16:50 -0700)
Add note about sentinel objects not supporting subclassing

Clarify that sentinel objects do not support subclassing.

Doc/library/functions.rst

index aa99d198e436d575a05bd4517a38c3242fa38a62..06fd5cdc7be2a63cd2015d3ca438de801cfe4f4e 100644 (file)
@@ -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.