asphalt.serialization.marshalling

asphalt.serialization.marshalling.default_marshaller(obj)

Retrieve the state of the given object.

Calls the __getstate__() method of the object if available, otherwise returns the __dict__ of the object.

Parameters:

obj (Any) – the object to marshal

Return type:

Any

Returns:

the marshalled object state

asphalt.serialization.marshalling.default_unmarshaller(instance, state)

Restore the state of an object.

If the __setstate__() method exists on the instance, it is called with the state object as the argument. Otherwise, the instance’s __dict__ is replaced with state.

Parameters:
Return type:

None