Closed huskyrobotdog closed 1 year ago
The type I want to get
Vec<(Kind, String, Decimal, Decimal, Decimal)>
Error: TypeError: 'Kind' object cannot be converted to 'Kind'
Could you post the full compilerinterpreter output. Usually such errors indicate that you use Kind
instances from two different PyO3-based extensions. (Due to static linking, they do not share types even if their Rust implementations do, i.e. Kind
from one extension has a different type than the Kind
from the other.)
Error: TypeError: 'Kind' object cannot be converted to 'Kind'
Could you post the full ~compiler~interpreter output. Usually such errors indicate that you use
Kind
instance from two different PyO3-based extensions. (Due to static linking, they do not share types even if their Rust implementations do, i.e.Kind
from one extension has a different type than theKind
from the other.)
Export enum as python class via pyo3.
Then use rust to call the python function, and the enum(Kind.Spot) returned by python cannot be converted to Rust enum(Kind::Spot) through extract
.
Tip: 'Kind' object cannot be converted to 'Kind'
Without a full minimal reproduction this just sounds like you're running up against #1444
against
Thanks, I probably got it. Types in static libraries are not the same as types from Rust sources.
Complex type conversion seems to go wrong.
Error: TypeError: 'Kind' object cannot be converted to 'Kind'
Rust :
Python :
Call :