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.
- 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 withstate
.- Parameters
instance (
Any
) – an uninitialized instancestate (
Any
) – the state object, as returned bydefault_marshaller()
- Return type