asphalt.serialization.serializers.pickle

class asphalt.serialization.serializers.pickle.PickleSerializer(protocol=5)

Serializes objects using the standard library pickle module.

Warning

This serializer is insecure because it allows execution of arbitrary code when deserializing. Avoid using this if at all possible.

Parameters

protocol (int) – pickle protocol level to use (defaults to the highest possible)

deserialize(payload)

Deserialize bytes into a Python object.

Return type

Any

property mimetype: str

Return the MIME type for this serialization format.

Return type

str

serialize(obj)

Serialize a Python object into bytes.

Return type

bytes