Implementation of conversion traits for 3rd party types
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.2k
- Forks
- 1k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 66
Description
PyO3 kind of has the same problem as serde: if you wanted to use 3rd-party types in your pyfunctions, the conversion traits (Serialize, FromPyObject) would have to be implemented by the lib that defines them, but usually isn't. In your crate using pyo3, you can then only work with newtype wrappers, which is ok but not great. In particular, it makes using the same functions/methods also from Rust annoying.
I don't really know of a workaround. But I would never have suspected about the one with inventory, used for avoiding specialization, so who knows... 😄
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing PyO3's existing conversion-trait handling for pyfunctions and the limitations described around third-party types. Investigate whether an approach such as the mentioned inventory workaround can support these conversions without newtype wrappers; done requires an agreed design and implementation path for using third-party types from Rust and Python.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, rust
- Domain
- api
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100