Skip to content

Commit ca5eb25

Browse files
authored
Apply suggestions from code review
1 parent 9f34167 commit ca5eb25

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

Doc/faq/programming.rst

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1914,16 +1914,16 @@ correctly using identity tests:
19141914
guaranteed to be distinct from other objects. For example, here is how
19151915
to implement a method that behaves like :meth:`dict.pop`::
19161916

1917-
_sentinel = object()
1918-
1919-
def pop(self, key, default=_sentinel):
1920-
if key in self:
1921-
value = self[key]
1922-
del self[key]
1923-
return value
1924-
if default is _sentinel:
1925-
raise KeyError(key)
1926-
return default
1917+
_sentinel = object()
1918+
1919+
def pop(self, key, default=_sentinel):
1920+
if key in self:
1921+
value = self[key]
1922+
del self[key]
1923+
return value
1924+
if default is _sentinel:
1925+
raise KeyError(key)
1926+
return default
19271927

19281928
3) Container implementations sometimes need to augment equality tests with
19291929
identity tests. This prevents the code from being confused by objects

0 commit comments

Comments
 (0)