Skip to content

Commit 690e0de

Browse files
authored
pythongh-149083: Change several other docs examples to use sentinel() (python#149213)
1 parent 8c611e1 commit 690e0de

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

Doc/faq/programming.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1924,7 +1924,7 @@ correctly using identity tests:
19241924

19251925
.. code-block:: python
19261926
1927-
_sentinel = object()
1927+
_sentinel = sentinel('_sentinel')
19281928
19291929
def pop(self, key, default=_sentinel):
19301930
if key in self:

Doc/howto/descriptor.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -594,7 +594,7 @@ a pure Python equivalent:
594594

595595
def object_getattribute(obj, name):
596596
"Emulate PyObject_GenericGetAttr() in Objects/object.c"
597-
null = object()
597+
null = sentinel('null')
598598
objtype = type(obj)
599599
cls_var = find_name_in_mro(objtype, name, null)
600600
descr_get = getattr(type(cls_var), '__get__', null)
@@ -1635,7 +1635,7 @@ by member descriptors:
16351635

16361636
.. testcode::
16371637

1638-
null = object()
1638+
null = sentinel('null')
16391639

16401640
class Member:
16411641

0 commit comments

Comments
 (0)