Different styles of persisted objects.

Function pickleMethod support function for copy_reg to pickle method refs
Function unpickleMethod Support function for copy_reg to unpickle method refs.
Function pickleModule support function for copy_reg to pickle module refs
Function unpickleModule support function for copy_reg to unpickle module refs
Function pickleStringO Reduce the given cStringO.
Function unpickleStringO Convert the output of pickleStringO into an appropriate type for the current python version. This may be called on Python 3 and will convert a cStringIO into an io.StringIO.
Function pickleStringI Reduce the given cStringI.
Function unpickleStringI Convert the output of pickleStringI into an appropriate type for the current Python version.
Class Ephemeral This type of object is never persisted; if possible, even references to it are eliminated.
Function doUpgrade Undocumented
Function requireUpgrade Require that a Versioned instance be upgraded completely first.
Class Versioned This type of object is persisted with versioning information.
Class _UniversalPicklingError A PicklingError catchable by both cPickle.PicklingError and pickle.PicklingError handlers.
Function _methodFunction Retrieve the function object implementing a method name given the class it's on and a method name.
Function _pickleFunction Reduce, in the sense of pickle's object.__reduce__ special method, a function object into its constituent parts.
Function _unpickleFunction Convert a function name into a function by importing it.
Function _aybabtu Get all of the parent classes of c, not including c itself, which are strict subclasses of Versioned.
def pickleMethod(method):

support function for copy_reg to pickle method refs

def _methodFunction(classObject, methodName):

Retrieve the function object implementing a method name given the class it's on and a method name.

ParametersclassObjectA class to retrieve the method's function from. (type: type or types.ClassType)
methodNameThe name of the method whose function to retrieve. (type: native str)
Returnsthe function object corresponding to the given method name. (type: types.FunctionType)
def unpickleMethod(im_name, im_self, im_class):

Support function for copy_reg to unpickle method refs.

Parametersim_nameThe name of the method. (type: native str)
im_selfThe instance that the method was present on. (type: object)
im_classThe class where the method was declared. (type: types.ClassType or type or None)
def _pickleFunction(f):

Reduce, in the sense of pickle's object.__reduce__ special method, a function object into its constituent parts.

ParametersfThe function to reduce. (type: types.FunctionType)
Returnsa 2-tuple of a reference to _unpickleFunction and a tuple of its arguments, a 1-tuple of the function's fully qualified name. (type: 2-tuple of callable, native string)
def _unpickleFunction(fullyQualifiedName):

Convert a function name into a function by importing it.

This is a synonym for twisted.python.reflect.namedAny, but imported locally to avoid circular imports, and also to provide a persistent name that can be stored (and deprecated) independently of namedAny.

ParametersfullyQualifiedNameThe fully qualified name of a function. (type: native str)
ReturnsA function object imported from the given location. (type: types.FunctionType)
def pickleModule(module):

support function for copy_reg to pickle module refs

def unpickleModule(name):

support function for copy_reg to unpickle module refs

def pickleStringO(stringo):

Reduce the given cStringO.

This is only called on Python 2, because the cStringIO module only exists on Python 2.

ParametersstringoThe string output to pickle. (type: cStringIO.OutputType)
def unpickleStringO(val, sek):

Convert the output of pickleStringO into an appropriate type for the current python version. This may be called on Python 3 and will convert a cStringIO into an io.StringIO.

ParametersvalThe content of the file. (type: bytes)
sekThe seek position of the file. (type: int)
Returnsa file-like object which you can write bytes to. (type: cStringIO.OutputType on Python 2, io.StringIO on Python 3.)
def pickleStringI(stringi):

Reduce the given cStringI.

This is only called on Python 2, because the cStringIO module only exists on Python 2.

ParametersstringiThe string input to pickle. (type: cStringIO.InputType)
Returnsa 2-tuple of (unpickleStringI, (bytes, pointer)) (type: 2-tuple of (function, (bytes, int)))
def unpickleStringI(val, sek):

Convert the output of pickleStringI into an appropriate type for the current Python version.

This may be called on Python 3 and will convert a cStringIO into an io.StringIO.

ParametersvalThe content of the file. (type: bytes)
sekThe seek position of the file. (type: int)
Returnsa file-like object which you can read bytes from. (type: cStringIO.OutputType on Python 2, io.StringIO on Python 3.)
def doUpgrade():
Undocumented
def requireUpgrade(obj):

Require that a Versioned instance be upgraded completely first.

def _aybabtu(c):

Get all of the parent classes of c, not including c itself, which are strict subclasses of Versioned.

Parametersca class
Returnslist of classes
API Documentation for twisted, generated by pydoctor at 2020-03-25 17:34:30.