Skip to content

lazyjson 2.4.0 — Node.set

Compare
Choose a tag to compare
@fenhl fenhl released this 08 Feb 12:10

This release adds the set method, which can be used to replace the contents of a node, to all nodes instead of just the root node. Example:

>>> f = lazyjson.File('example-file.json')
>>> node = f['someKey']
>>> print(f)
{'someKey': ['a', 'b', 'c', 'd', 'e', 'f']}
>>> node.set(42)
>>> print(f)
{'someKey': 42}