Vega strike Python Modules doc  0.5.1
Documentation of the " Modules " folder of Vega strike
 All Data Structures Namespaces Files Functions Variables
pickle Namespace Reference

Data Structures

class  PickleError
 
class  PicklingError
 
class  UnpicklingError
 
class  _Stop
 
class  Pickler
 
class  Unpickler
 
class  _EmptyClass
 

Functions

def whichmodule
 
def dump
 
def dumps
 
def load
 
def loads
 

Variables

string __version__ = "$Revision: 5816 $"
 
list __all__
 
string format_version = "1.3"
 
list compatible_formats = ["1.0", "1.1", "1.2"]
 
 mdumps = marshal.dumps
 
 mloads = marshal.loads
 
 PyStringMap = None
 
 UnicodeType = None
 
string MARK = '('
 
string STOP = '.'
 
string POP = '0'
 
string POP_MARK = '1'
 
string DUP = '2'
 
string FLOAT = 'F'
 
string INT = 'I'
 
string BININT = 'J'
 
string BININT1 = 'K'
 
string LONG = 'L'
 
string BININT2 = 'M'
 
string NONE = 'N'
 
string PERSID = 'P'
 
string BINPERSID = 'Q'
 
string REDUCE = 'R'
 
string STRING = 'S'
 
string BINSTRING = 'T'
 
string SHORT_BINSTRING = 'U'
 
string UNICODE = 'V'
 
string BINUNICODE = 'X'
 
string APPEND = 'a'
 
string BUILD = 'b'
 
string GLOBAL = 'c'
 
string DICT = 'd'
 
string EMPTY_DICT = '}'
 
string APPENDS = 'e'
 
string GET = 'g'
 
string BINGET = 'h'
 
string INST = 'i'
 
string LONG_BINGET = 'j'
 
string LIST = 'l'
 
string EMPTY_LIST = ']'
 
string OBJ = 'o'
 
string PUT = 'p'
 
string BINPUT = 'q'
 
string LONG_BINPUT = 'r'
 
string SETITEM = 's'
 
string TUPLE = 't'
 
string EMPTY_TUPLE = ')'
 
string SETITEMS = 'u'
 
string BINFLOAT = 'G'
 
dictionary classmap = {}
 

Detailed Description

Create portable serialized representations of Python objects.

See module cPickle for a (much) faster implementation.
See module copy_reg for a mechanism for registering custom picklers.

Classes:

    Pickler
    Unpickler

Functions:

    dump(object, file)
    dumps(object) -> string
    load(file) -> object
    loads(string) -> object

Misc variables:

    __version__
    format_version
    compatible_formats

Function Documentation

def pickle.dump (   object,
  file,
  bin = 0 
)

Definition at line 972 of file pickle.py.

973 def dump(object, file, bin = 0):
974  Pickler(file, bin).dump(object)
def pickle.dumps (   object,
  bin = 0 
)

Definition at line 975 of file pickle.py.

References dump().

976 def dumps(object, bin = 0):
977  file = StringIO()
978  Pickler(file, bin).dump(object)
979  return file.getvalue()
def pickle.load (   file)

Definition at line 980 of file pickle.py.

981 def load(file):
982  return Unpickler(file).load()
def pickle.loads (   str)

Definition at line 983 of file pickle.py.

References load().

984 def loads(str):
985  file = StringIO(str)
986  return Unpickler(file).load()
def pickle.whichmodule (   cls,
  clsname 
)
Figure out the module in which a class occurs.

Search sys.modules for the module.
Cache in classmap.
Return a module name.
If the class cannot be found, return __main__.

Definition at line 558 of file pickle.py.

559 def whichmodule(cls, clsname):
560  """Figure out the module in which a class occurs.
561 
562  Search sys.modules for the module.
563  Cache in classmap.
564  Return a module name.
565  If the class cannot be found, return __main__.
566  """
567  if classmap.has_key(cls):
568  return classmap[cls]
569 
570  for name, module in sys.modules.items():
571  if name != '__main__' and \
572  hasattr(module, clsname) and \
573  getattr(module, clsname) is cls:
574  break
575  else:
576  name = '__main__'
577  classmap[cls] = name
578  return name
579 

Variable Documentation

list __all__
Initial value:
1 = ["PickleError", "PicklingError", "UnpicklingError", "Pickler",
2  "Unpickler", "dump", "dumps", "load", "loads"]

Definition at line 35 of file pickle.py.

string __version__ = "$Revision: 5816 $"

Definition at line 26 of file pickle.py.

string APPEND = 'a'

Definition at line 83 of file pickle.py.

string APPENDS = 'e'

Definition at line 88 of file pickle.py.

string BINFLOAT = 'G'

Definition at line 103 of file pickle.py.

string BINGET = 'h'

Definition at line 90 of file pickle.py.

string BININT = 'J'

Definition at line 70 of file pickle.py.

string BININT1 = 'K'

Definition at line 71 of file pickle.py.

string BININT2 = 'M'

Definition at line 73 of file pickle.py.

string BINPERSID = 'Q'

Definition at line 76 of file pickle.py.

string BINPUT = 'q'

Definition at line 97 of file pickle.py.

string BINSTRING = 'T'

Definition at line 79 of file pickle.py.

string BINUNICODE = 'X'

Definition at line 82 of file pickle.py.

string BUILD = 'b'

Definition at line 84 of file pickle.py.

dictionary classmap = {}

Definition at line 555 of file pickle.py.

list compatible_formats = ["1.0", "1.1", "1.2"]

Definition at line 39 of file pickle.py.

string DICT = 'd'

Definition at line 86 of file pickle.py.

string DUP = '2'

Definition at line 67 of file pickle.py.

string EMPTY_DICT = '}'

Definition at line 87 of file pickle.py.

string EMPTY_LIST = ']'

Definition at line 94 of file pickle.py.

string EMPTY_TUPLE = ')'

Definition at line 101 of file pickle.py.

string FLOAT = 'F'

Definition at line 68 of file pickle.py.

string format_version = "1.3"

Definition at line 38 of file pickle.py.

string GET = 'g'

Definition at line 89 of file pickle.py.

string GLOBAL = 'c'

Definition at line 85 of file pickle.py.

string INST = 'i'

Definition at line 91 of file pickle.py.

string INT = 'I'

Definition at line 69 of file pickle.py.

string LIST = 'l'

Definition at line 93 of file pickle.py.

string LONG = 'L'

Definition at line 72 of file pickle.py.

string LONG_BINGET = 'j'

Definition at line 92 of file pickle.py.

string LONG_BINPUT = 'r'

Definition at line 98 of file pickle.py.

string MARK = '('

Definition at line 63 of file pickle.py.

mdumps = marshal.dumps

Definition at line 41 of file pickle.py.

mloads = marshal.loads

Definition at line 42 of file pickle.py.

string NONE = 'N'

Definition at line 74 of file pickle.py.

string OBJ = 'o'

Definition at line 95 of file pickle.py.

string PERSID = 'P'

Definition at line 75 of file pickle.py.

string POP = '0'

Definition at line 65 of file pickle.py.

string POP_MARK = '1'

Definition at line 66 of file pickle.py.

string PUT = 'p'

Definition at line 96 of file pickle.py.

PyStringMap = None

Definition at line 55 of file pickle.py.

string REDUCE = 'R'

Definition at line 77 of file pickle.py.

string SETITEM = 's'

Definition at line 99 of file pickle.py.

string SETITEMS = 'u'

Definition at line 102 of file pickle.py.

string SHORT_BINSTRING = 'U'

Definition at line 80 of file pickle.py.

string STOP = '.'

Definition at line 64 of file pickle.py.

string STRING = 'S'

Definition at line 78 of file pickle.py.

string TUPLE = 't'

Definition at line 100 of file pickle.py.

string UNICODE = 'V'

Definition at line 81 of file pickle.py.

UnicodeType = None

Definition at line 60 of file pickle.py.