cirq.cirq_type_from_json
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.
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-06-27 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-06-27 UTC."],[],[]]