|View source on GitHub|
Create a dataclass that supports JSON serialization.
cirq.json_serializable_dataclass( _cls: Optional[Type] = None, *, namespace: Optional[str] = None, init: bool = True, repr: bool = True, eq: bool = True, order: bool = False, unsafe_hash: bool = False, frozen: bool = False )
This function defers to the ordinary
dataclass decorator but appends
_json_dict_ protocol method which automatically determines
the appropriate fields from the dataclass.
Dataclasses are implemented with somewhat complex metaprogramming, and
tooling (PyCharm, mypy) have special cases for dealing with classes
decorated with @dataclass. There is very little support (and no plans for
support) for decorators that wrap @dataclass like this. Consider explicitly
_json_dict_ on your dataclasses which simply