Returns a type object for JSON deserialization of type_str
.
cirq.cirq_type_from_json(
type_str: str, resolvers: Optional[Sequence[JsonResolver]] = None
) -> Type
This method is not part of the base deserialization path. Together with
json_cirq_type
, it can be used to provide type-object deserialization
for classes that need it.
Args |
type_str
|
string representation of the type to deserialize.
|
resolvers
|
list of JsonResolvers to use in type resolution. If this is
left blank, DEFAULT_RESOLVERS will be used.
|
Returns |
The type object T for which json_cirq_type(T) matches type_str .
|
Raises |
ValueError
|
if type_str does not have a match in resolvers , or if the
match found is a factory method instead of a type.
|