diff --git a/Doc/library/difflib.rst b/Doc/library/difflib.rst index ce948a6860f02c..2609ef03045144 100644 --- a/Doc/library/difflib.rst +++ b/Doc/library/difflib.rst @@ -720,7 +720,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) @@ -735,7 +735,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 1b1e9f479cbe08..2451f4fa32be79 100644 --- a/Doc/reference/compound_stmts.rst +++ b/Doc/reference/compound_stmts.rst @@ -1108,7 +1108,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. @@ -1120,13 +1120,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. @@ -1144,8 +1144,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: