Open PigeonF opened 2 years ago
Hey! Thanks for reporting the issue.
In this case, it can only be fixed by pyo3
. We can not implement the ToPyObject
trait for arrays in this crate.
It sounds like pyo3
is simply missing a impl ToPyObject for [T; N]
. At a first glance, I don't see a reason why that trait wouldn't be possible to implement for arrays. It's probably just missing because nobody thought to add it.
Hi!
First, thanks for the awesome project, it is very useful for plotting 👍 .
I am trying to use an array in
inline_python
, but it cannot be converted, because[T; N]
does not implementToPyObject
.One solution is to convert the array to a slice, but I think supporting to an array should still be supported.
While searching, I found https://github.com/PyO3/pyo3/blob/main/src/conversions/array.rs, which allows for conversion between arrays and python objects, but as far as I can tell, this is not picked up because it only implements
IntoPy<PyObject>
for[T; N]
, notToPyObject
.Thus, I do not know if this is an issue with
inline_python
, or withPyO3
. Since I am directly depending oninline_python
I decided to open an issue here.Maybe related: #10