]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Fix indentation in `json.AttrDict` REPL example (#104930)
authorAlex Waygood <Alex.Waygood@Gmail.com>
Thu, 25 May 2023 13:05:43 +0000 (14:05 +0100)
committerGitHub <noreply@github.com>
Thu, 25 May 2023 13:05:43 +0000 (14:05 +0100)
This is causing the docs to be rendered incorrectly.

Doc/library/json.rst

index a752efd7ef2292d3a59c95fe6fa22be2ee353b4f..ef58dd0942364047b958ac3740fce22fed6f4429 100644 (file)
@@ -559,14 +559,14 @@ Exceptions
 
    .. doctest::
 
-        >>> json_string = '{"mercury": 88, "venus": 225, "earth": 365, "mars": 687}'
-        >>> orbital_period = json.loads(json_string, object_hook=AttrDict)
-        >>> orbital_period['earth']     # Dict style lookup
-        365
-        >>> orbital_period.earth        # Attribute style lookup
-        365
-        >>> orbital_period.keys()       # All dict methods are present
-        dict_keys(['mercury', 'venus', 'earth', 'mars'])
+       >>> json_string = '{"mercury": 88, "venus": 225, "earth": 365, "mars": 687}'
+       >>> orbital_period = json.loads(json_string, object_hook=AttrDict)
+       >>> orbital_period['earth']     # Dict style lookup
+       365
+       >>> orbital_period.earth        # Attribute style lookup
+       365
+       >>> orbital_period.keys()       # All dict methods are present
+       dict_keys(['mercury', 'venus', 'earth', 'mars'])
 
    Attribute style access only works for keys that are valid attribute
    names.  In contrast, dictionary style access works for all keys.  For