https://github.com/python/cpython/commit/690e0de70671a07eba705156508a49c609f44bb1
commit: 690e0de70671a07eba705156508a49c609f44bb1
branch: main
author: sobolevn <[email protected]>
committer: sobolevn <[email protected]>
date: 2026-05-01T22:53:28+03:00
summary:

gh-149083: Change several other docs examples to use `sentinel()` (#149213)

files:
M Doc/faq/programming.rst
M Doc/howto/descriptor.rst

diff --git a/Doc/faq/programming.rst b/Doc/faq/programming.rst
index ff34bb5d71c22b..591565cbc01357 100644
--- a/Doc/faq/programming.rst
+++ b/Doc/faq/programming.rst
@@ -1924,7 +1924,7 @@ correctly using identity tests:
 
    .. code-block:: python
 
-      _sentinel = object()
+      _sentinel = sentinel('_sentinel')
 
       def pop(self, key, default=_sentinel):
           if key in self:
diff --git a/Doc/howto/descriptor.rst b/Doc/howto/descriptor.rst
index 07a405837d9229..a7a68281860cb5 100644
--- a/Doc/howto/descriptor.rst
+++ b/Doc/howto/descriptor.rst
@@ -594,7 +594,7 @@ a pure Python equivalent:
 
     def object_getattribute(obj, name):
         "Emulate PyObject_GenericGetAttr() in Objects/object.c"
-        null = object()
+        null = sentinel('null')
         objtype = type(obj)
         cls_var = find_name_in_mro(objtype, name, null)
         descr_get = getattr(type(cls_var), '__get__', null)
@@ -1635,7 +1635,7 @@ by member descriptors:
 
 .. testcode::
 
-    null = object()
+    null = sentinel('null')
 
     class Member:
 

_______________________________________________
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