From 0530ad6be02b2d0a4ff796e86e719511f6ed1fc3 Mon Sep 17 00:00:00 2001 From: Nice Zombies Date: Mon, 19 Aug 2024 09:43:28 +0200 Subject: [PATCH] Simplify example --- src/jsonyx/__init__.py | 8 ++++---- src/jsonyx/_manipulator.py | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/jsonyx/__init__.py b/src/jsonyx/__init__.py index a9ea4fb..8bcf4bc 100644 --- a/src/jsonyx/__init__.py +++ b/src/jsonyx/__init__.py @@ -653,7 +653,7 @@ def apply_patch( :rtype: Any >>> import jsonyx as json - >>> json.apply_patch([0, 1, 2, 3, 4, 5], {"op": "clear"}) + >>> json.apply_patch([1, 2, 3], {"op": "clear"}) [] .. versionadded:: 2.0 @@ -692,13 +692,13 @@ def run_select_query( # noqa: PLR0913 :rtype: list[_Node] >>> import jsonyx as json - >>> root = [[0, 1, 2, 3, 4, 5]] + >>> root = [[1, 2, 3, 4, 5, 6]] >>> node = root, 0 - >>> for target, key in json.run_select_query(node, "$[@>=3]"): + >>> for target, key in json.run_select_query(node, "$[@>3]"): ... target[key] = None ... >>> root[0] - [0, 1, 2, None, None, None] + [1, 2, 3, None, None, None] .. versionadded:: 2.0 """ diff --git a/src/jsonyx/_manipulator.py b/src/jsonyx/_manipulator.py index 0587e2a..12fef88 100644 --- a/src/jsonyx/_manipulator.py +++ b/src/jsonyx/_manipulator.py @@ -547,7 +547,7 @@ def apply_patch( :rtype: Any >>> import jsonyx as json - >>> json.Manipulator().apply_patch([0, 1, 2, 3, 4, 5], {"op": "clear"}) + >>> json.Manipulator().apply_patch([1, 2, 3], {"op": "clear"}) [] """ root: list[Any] = [obj] @@ -587,13 +587,13 @@ def run_select_query( :rtype: list[_Node] >>> import jsonyx as json - >>> root = [[0, 1, 2, 3, 4, 5]] + >>> root = [[1, 2, 3, 4, 5, 6]] >>> node = root, 0 - >>> for target, key in json.Manipulator().run_select_query(node, "$[@>=3]"): + >>> for target, key in json.Manipulator().run_select_query(node, "$[@>3]"): ... target[key] = None ... >>> root[0] - [0, 1, 2, None, None, None] + [1, 2, 3, None, None, None] """ if isinstance(nodes, tuple): nodes = [nodes]