Movatterモバイル変換


[0]ホーム

URL:


Previous PageUp One LevelNext PagePython Library ReferenceContentsModule IndexIndex
Previous:3.15 cPickleUp:3. Python Runtime ServicesNext:3.17 shelve

3.16copy_reg -- Registerpickle support functions

Thecopy_reg module provides support for thepickle andcPickle modules. Thecopy module is likely to use this in thefuture as well. It provides configuration information about objectconstructors which are not classes. Such constructors may be factoryfunctions or class instances.

constructor(object)
Declaresobject to be a valid constructor. Ifobject is not callable (and hence not valid as a constructor), raisesTypeError.

pickle(type, function[, constructor])
Declares thatfunction should be used as a ``reduction'' function for objects of typetype;type must not be a ``classic'' class object. (Classic classes are handled differently; see the documentation for thepickle module for details.)function should return either a string or a tuple containing two or three elements.

The optionalconstructor parameter, if provided, is a callable object which can be used to reconstruct the object when called with the tuple of arguments returned byfunction at pickling time.TypeError will be raised ifobject is a class orconstructor is not callable.

See thepickle module for more details on the interface expected offunction andconstructor.


Previous PageUp One LevelNext PagePython Library ReferenceContentsModule IndexIndex
Previous:3.15 cPickleUp:3. Python Runtime ServicesNext:3.17 shelve
Release 2.2.3, documentation updated on 30 May 2003.
SeeAbout this document... for information on suggesting changes.
[8]ページ先頭

©2009-2026 Movatter.jp