From: sobolevn Date: Fri, 1 May 2026 19:53:28 +0000 (+0300) Subject: gh-149083: Change several other docs examples to use `sentinel()` (#149213) X-Git-Tag: v3.15.0b1~133 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=690e0de70671a07eba705156508a49c609f44bb1;p=thirdparty%2FPython%2Fcpython.git gh-149083: Change several other docs examples to use `sentinel()` (#149213) --- diff --git a/Doc/faq/programming.rst b/Doc/faq/programming.rst index ff34bb5d71c2..591565cbc013 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 07a405837d92..a7a68281860c 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: