dispatch_table
A pickler object’s dispatch table is a registry of reduction functions of the kind which can be declared using copyreg.pickle()
. It is a mapping whose keys are classes and whose values are reduction functions. A reduction function takes a single argument of the associated class and should conform to the same interface as a __reduce__()
method.
By default, a pickler object will not have a dispatch_table
attribute, and it will instead use the global dispatch table managed by the copyreg
module. However, to customize the pickling for a specific pickler object one can set the dispatch_table
attribute to a dict-like object. Alternatively, if a subclass of Pickler
has a dispatch_table
attribute then this will be used as the default dispatch table for instances of that class.
See Dispatch Tables for usage examples.
New in version 3.3.
Please login to continue.