pub fn to_pyobject<'py, T>(
    py: Python<'py>,
    value: &T
) -> Result<&'py PyAny, Error>where
    T: Serialize + ?Sized,