pygsti.serialization.jsoncodec.decode_obj

Contents

pygsti.serialization.jsoncodec.decode_obj#

decode_obj(json_obj, binary)#

Inverse of encode_obj().

Decodes the JSON-compatible json_obj object into the original Python object that was encoded.

Parameters:
  • json_obj (object) – The JSON-compabtible object to decode. Note that this is NOT a JSON string, but rather the object that would be decoded from such a string (by json.loads, for instance).

  • binary (bool) – Whether json_obj is a binary format or not. If so, then the decoding expects all strings to be binary strings i.e. b’name’ instead of just ‘name’. The value of this argument should match that used in the original call to encode_obj().

Returns:

A Python object.

Return type:

object