so i have the following code to wrap my rust code in a python lib: rs #[pyfunction] fn optimize_func( objective_raw: Bound<'_, PyAny>, ... ) -> PyResult<Vec<usize>> { let objective = |v: &Vec<f64>| { objective_raw .call1(v) .unwrap() .extract() .expect("objective returned wrong type, must retur f64") }; ... } which fails to compile with the error: ```error[E0277]: the trait bound Vec<f64>: IntoPy<Py<PyTuple>> is not satisfied
--> src/lib.rs:35:20
|
35 | .call1(v.clone())
| ----- ^^^^^^^^^ the trait IntoPy<Py<PyTuple>> is not implemented for Vec<f64>
| |
| required by a bound introduced by this call
|
= help: the trait IntoPy<Py<PyAny>> is implemented for Vec<f64>
= help: for that trait implementation, expected PyAny, found PyTuple
note: required by a bound in call1
--> /home/fbwdw/.cargo/registry/src/index.crates.io-6f17d22bba15001f/pyo3-0.21.2/src/types/any.rs:1335:32
|
1335 | fn call1(&self, args: impl IntoPy<Py<PyTuple>>) -> PyResult<Bound<'py, PyAny>>;
| ^^^^^^^^^^^^^^^^^^^ required by this bound in PyAnyMethods::call1