pyrseus.core.pickle¶

Helpers for writing Executor classes that need to interact with pickle-based serialization.

There are two main use cases:

Module Attributes

Ret

Represents the generic return type of a submitted callable.

Functions

call_with_round_trip_pickling(func, args, ...)

Calls func(*args, **kwargs), but (a) running those three things through try_pickle_round_trip first, and then (b) running the result through try_pickle_round_trip too.

get_round_trip_keywords()

Helper for creating executors that wrap try_pickle_round_trip and/or call_with_round_trip_pickling.

try_pickle_round_trip(obj, *[, dumps, ...])

Attempts to pickle and unpickle obj using dumps and loads, to help with testing and/or troubleshooting.

Classes

CustomPickledClosure(func, args, kwargs, ...)

OncePickledObject(obj, dumps, loads)

Creates a wrapper around an arbitrary Python object that forces it to be pickled with the chosen pickler, but a copy of the original unwrapped object is returned at unpickling time.