Skip to content

Commit

Permalink
Simplify example
Browse files Browse the repository at this point in the history
  • Loading branch information
nineteendo committed Aug 19, 2024
1 parent 8c1de40 commit 0530ad6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/jsonyx/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
"""
Expand Down
8 changes: 4 additions & 4 deletions src/jsonyx/_manipulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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]
Expand Down

0 comments on commit 0530ad6

Please sign in to comment.