IPython.parallel doesn't do much in the way of serialization.
It has custom zero-copy handling of numpy arrays,
but other than that, it doesn't do anything other than the bare minimum to make basic interactively defined functions and classes sendable.

There are a few projects that extend pickle to make just about anything sendable, and one of these is dill.

To install dill:

pip install --pre dill

First, as always, we create a task function, this time with a closure

In [1]:

defmake_closure(a):"""make a function with a closure, and return it"""defhas_closure(b):returna*breturnhas_closure