Skip to main content

Protocol

This class defines a set of supported serialization formats as string-based enumeration members. It allows for the selection between JSON and Pickle protocols for data exchange or storage.

Attributes

AttributeTypeDescription
jsonstring = jsonSpecifies the JSON serialization format for data exchange.
picklestring = pickleSpecifies the Python pickle serialization format for preserving complex object hierarchies.

Methods


json()

def json() - > string

Represents the JSON serialization protocol for data exchange.

Returns

TypeDescription
stringThe string literal 'json'

pickle()

def pickle() - > string

Represents the Python pickle serialization protocol for binary object persistence.

Returns

TypeDescription
stringThe string literal 'pickle'