View source on GitHub |
An object that can be turned into JSON dictionaries.
cirq.SupportsJSON(
*args, **kwargs
)
The magic method _json_dict_
must return a trivially json-serializable
type or other objects that support the SupportsJSON protocol.
During deserialization, a class must be able to be resolved (see
the docstring for read_json
) and must be able to be (re-)constructed
from the serialized parameters. If the type defines a classmethod
_from_json_dict_
, that will be called. Otherwise, the cirq_type
key
will be popped from the dictionary and used as kwargs to the type's
constructor.
Methods
_json_dict_
_json_dict_() -> Union[None, NotImplementedType, Dict[Any, Any]]