---------------------------------------------------------------------- This is the API documentation for the gdtest_docstring_seealso library. ---------------------------------------------------------------------- ## Functions Public functions serialize(obj: object) -> bytes Serialize a Python object to bytes. Converts the given object into a byte string representation using pickle serialization. Parameters ---------- obj The Python object to serialize. Must be picklable. Returns ------- bytes The serialized byte string. Raises ------ TypeError If the object cannot be pickled. See Also -------- deserialize : Convert bytes back into a Python object. to_json : Serialize an object to a JSON string instead. Examples -------- >>> data = serialize({"key": "value"}) >>> isinstance(data, bytes) True deserialize(data: bytes) -> object Deserialize bytes back into a Python object. Reconstructs a Python object from a byte string that was previously created by ``serialize``. Parameters ---------- data A byte string produced by ``serialize``. Returns ------- object The reconstructed Python object. Raises ------ ValueError If the byte string is corrupted or invalid. See Also -------- serialize : Convert a Python object to bytes. Examples -------- >>> original = {"key": "value"} >>> data = serialize(original) >>> deserialize(data) {'key': 'value'} to_json(obj: object) -> str Serialize a Python object to a JSON string. Converts the given object into a human-readable JSON string. Supports dicts, lists, strings, numbers, booleans, and None. Parameters ---------- obj The Python object to serialize. Must be JSON-serializable. Returns ------- str A JSON-formatted string. Raises ------ TypeError If the object is not JSON-serializable. See Also -------- serialize : Serialize to bytes using pickle (supports more types). from_json : Parse a JSON string back into a Python object. Examples -------- >>> to_json({"name": "test", "value": 42}) '{"name": "test", "value": 42}'