Skip to content

How to implement IntoPyObject for a class which extends a base class? #4955

Answered by Icxolu
tesujimath asked this question in Questions
Discussion options

You must be logged in to vote

Since you already use Py::new you already have a Python object and there is no need to use IntoPyObject. You should be able to just
replace your into_py call with into_any to remove the type info.


Previously IntoPy for Py was just throwing away the type information. IntoPyObject is also implemented for Py but now keeps the type information. IntoPyObjectExt also provides a few helpers for common type conversions.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@tesujimath
Comment options

Answer selected by tesujimath
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants