I met a pickling error when dealing with multiprocessing:
from multiprocessing import Pool def test_func(x): return x**2 class Test: @classmethod
Instead of returning the actual class object from _pickle_method, return a string that can be used to import it when unpickling and then do that in _unpickle_method
_pickle_method
_unpickle_method