pyrseus.core.pickle.call_with_round_trip_pickling

pyrseus.core.pickle.call_with_round_trip_pickling(func, args, kwargs, **round_trip_kwargs)[source]

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.

This function is designed for serial executors that help detect picklability problems in submitted tasks.

Parameters:
  • func – function to call after round-trip pickling it

  • args – positional arguments to pass to func after round trip pickling

  • kwargs – keyword arguments to pass to func after round trip pickling

  • round_trip_kwargs – passed to try_pickle_round_trip to override the round trip pickling settings

Returns:

the return value of func(*args, **kwargs), after doing the two round trip pickling tests