From 1a1d99c740d3dc93e600a960441027c88c4cdc74 Mon Sep 17 00:00:00 2001 From: Ezio Melotti Date: Sun, 15 Oct 2023 03:37:44 +0200 Subject: [PATCH] Fix wrong markup and list numbers. --- Doc/library/difflib.rst | 4 ++-- Doc/reference/compound_stmts.rst | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Doc/library/difflib.rst b/Doc/library/difflib.rst index c553611401d018..2fd4290974a3c5 100644 --- a/Doc/library/difflib.rst +++ b/Doc/library/difflib.rst @@ -718,7 +718,7 @@ Finally, we compare the two: >>> result = list(d.compare(text1, text2)) -``result`` is a list of strings, so let's pretty-print it: +``result`` is a list of strings, so let's pretty-print it:: >>> from pprint import pprint >>> pprint(result) @@ -733,7 +733,7 @@ Finally, we compare the two: '? ++++ ^ ^\n', '+ 5. Flat is better than nested.\n'] -As a single multi-line string it looks like this: +As a single multi-line string it looks like this:: >>> import sys >>> sys.stdout.writelines(result) diff --git a/Doc/reference/compound_stmts.rst b/Doc/reference/compound_stmts.rst index f79db828604b24..d0b2e8014c9fb4 100644 --- a/Doc/reference/compound_stmts.rst +++ b/Doc/reference/compound_stmts.rst @@ -1107,7 +1107,7 @@ subject value: If only keyword patterns are present, they are processed as follows, one by one: - I. The keyword is looked up as an attribute on the subject. + 1. The keyword is looked up as an attribute on the subject. * If this raises an exception other than :exc:`AttributeError`, the exception bubbles up. @@ -1119,13 +1119,13 @@ subject value: pattern fails; if this succeeds, the match proceeds to the next keyword. - II. If all keyword patterns succeed, the class pattern succeeds. + 2. If all keyword patterns succeed, the class pattern succeeds. If any positional patterns are present, they are converted to keyword patterns using the :data:`~object.__match_args__` attribute on the class ``name_or_attr`` before matching: - I. The equivalent of ``getattr(cls, "__match_args__", ())`` is called. + 1. The equivalent of ``getattr(cls, "__match_args__", ())`` is called. * If this raises an exception, the exception bubbles up. @@ -1143,8 +1143,8 @@ subject value: .. seealso:: :ref:`class-pattern-matching` - II. Once all positional patterns have been converted to keyword patterns, - the match proceeds as if there were only keyword patterns. + 2. Once all positional patterns have been converted to keyword patterns, + the match proceeds as if there were only keyword patterns. For the following built-in types the handling of positional subpatterns is different: