-
Notifications
You must be signed in to change notification settings - Fork 741
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ENH: boiler plate for IntoPy<PyObject>
#4458
Comments
In PyO3 0.23 we are going to release a new trait |
That sounds interesting and could be quite useful for migrating. For these newtype enums the conversion seems indeed quite straight forward, but for more complex enums and structs it's a bit unclear what the resulting Python object should be... maybe |
I may very well be implementing a weak design pattern, but I regularly use an
enum
to control Ruststructs
passed as Pythonclasses
. Theenum
itself does not need to be python class (so refutes the doc comment "The easiest way to implement IntoPy is by exposing a struct as a native Python object by annotating it with [#[pyclass]]")The
FromPyObject
can be automatically derived, but I often implementIntoPy<PyObject>
directly using repeatable boiler plate code such as the following. Can this be automatic in pyo3?The text was updated successfully, but these errors were encountered: