IPython Documentation

Table Of Contents

Previous topic

Module: utils.pickleshare

Next topic

Module: utils.process

This Page


This documentation is for an old version of IPython. You can find docs for newer versions here.

Module: utils.pickleutil

Pickle related utilities. Perhaps this should be called ‘can’.

6 Classes

class IPython.utils.pickleutil.CannedObject(obj, keys=[], hook=None)

Bases: object

__init__(obj, keys=[], hook=None)

can an object for safe pickling


obj: :

The object to be canned

keys: list (optional) :

list of attribute names that will be explicitly canned / uncanned

hook: callable (optional) :

An optional extra callable, which can do additional processing of the uncanned object.

large data may be offloaded into the buffers list, :

used for zero-copy transfers. :

class IPython.utils.pickleutil.Reference(name)

Bases: IPython.utils.pickleutil.CannedObject

object for wrapping a remote reference by name.

class IPython.utils.pickleutil.CannedFunction(f)

Bases: IPython.utils.pickleutil.CannedObject

class IPython.utils.pickleutil.CannedClass(cls)

Bases: IPython.utils.pickleutil.CannedObject

class IPython.utils.pickleutil.CannedArray(obj)

Bases: IPython.utils.pickleutil.CannedObject

class IPython.utils.pickleutil.CannedBytes(obj)

Bases: IPython.utils.pickleutil.CannedObject


alias of str

10 Functions

IPython.utils.pickleutil.istype(obj, check)

like isinstance(obj, check), but strict

This won’t catch subclasses.


prepare an object for pickling


can the values of a dict


can the elements of a sequence

IPython.utils.pickleutil.uncan(obj, g=None)

invert canning

IPython.utils.pickleutil.uncan_dict(obj, g=None)
IPython.utils.pickleutil.uncan_sequence(obj, g=None)