Json API¶
API for working with the Json type.
Import this module like this:
from sympathy.api import json
Class json.File
¶
- class sympathy.typeutils.json.File(filename: Optional[str] = None, mode: str = 'r', **kwargs)[source]¶
A Json structure.
Any node port with the Json type will produce an object of this type.
- source(other, shallow=False)[source]¶
Update self with the data from other, discarding any previous state in self.
- Parameters
other (type of self) – Object used as the source for (to update) self.
shallow (bool) –
When shallow is True a deepcopy of other will be avoided to improve performance, shallow=True must only be used in operations that do not modify other.
When shallow is False the result should be similar to performing the shallow=True with a deepcopy of other so that no modifications of either self or other, after the source operation, can affect the other object.