Currently, Python classes / functions generated with Pyo3 are not picklable (PyO3/pyo3#100) which makes their use problematic in typical data science workflows (e.g. with joblib parallel or in scikit-learn pipelines).
Implementing __getstate__, __setstate__ methods is probably necessary to make it work.