Skip to content

Commit 9f34167

Browse files
authored
Fix indentation of numbered list and literal block
1 parent fba475a commit 9f34167

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

Doc/faq/programming.rst

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1906,28 +1906,28 @@ In the standard library code, you will see several common patterns for
19061906
correctly using identity tests:
19071907

19081908
1) As recommended by :pep:`8`, an identity test is the preferred way to check
1909-
for ``None``. This reads like plain English in code and avoids confusion with
1910-
other objects that may have boolean values that evaluate to false.
1909+
for ``None``. This reads like plain English in code and avoids confusion
1910+
with other objects that may have boolean values that evaluate to false.
19111911

19121912
2) Detecting optional arguments can be tricky when ``None`` is a valid input
1913-
value. In those situations, you can create a singleton sentinel object
1914-
guaranteed to be distinct from other objects. For example, here is how
1915-
to implement a method that behaves like :meth:`dict.pop`::
1913+
value. In those situations, you can create a singleton sentinel object
1914+
guaranteed to be distinct from other objects. For example, here is how
1915+
to implement a method that behaves like :meth:`dict.pop`::
19161916

1917-
_sentinel = object()
1917+
_sentinel = object()
19181918

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
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
1929-
identity tests. This prevents the code from being confused by objects such as
1930-
``float('NaN')`` that are not equal to themselves.
1929+
identity tests. This prevents the code from being confused by objects
1930+
such as ``float('NaN')`` that are not equal to themselves.
19311931

19321932
For example, here is the implementation of
19331933
:meth:`!collections.abc.Sequence.__contains__`::

0 commit comments

Comments
 (0)