jsonyx.paste_values¶
- jsonyx.paste_values(current_nodes, values, operation, *, allow=NOTHING)[source]¶
Paste value to a node or values to a list of nodes.
Added in version 2.0.
Changed in version 2.4: Removed
use_decimal.- Parameters:
- Raises:
IndexError – if an index is out of range
JSONSyntaxError – if a query is invalid
KeyError – if a key is not found
TypeError – if a value has the wrong type
ValueError – if a value is invalid
- Example:
>>> import jsonyx as json >>> obj = [1, 2, 3] >>> root = [obj] >>> node = root, 0 # pointer to obj >>> json.paste_values(node, 4, {"mode": "append"}) >>> root[0] [1, 2, 3, 4]
Tip
Use
jsonyx.Manipulatordirectly for better performance.