Export Rust traits as Abstract Base Classes (ABCs) on Python
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.2k
- Forks
- 1k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 66
Description
It would be an interesting feature to be able to export traits from Rust to Python, perhaps with a #[pytrait] macro, or with some modification to #[pyclass]. I think this could be best solved with Python's Abstract Base Classes.
When this was proposed on gitter, @davidhewitt suggested that this should be experimented in a new crate, which could later be merged into pyo3 if it's popular and stable enough.
I personally won't be able to work on this for now, so I'm opening this to have the tracking issue and in case someone wants to give it a try.
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 experimenting in a new crate, as suggested in the issue, and review how Rust traits could map to Python Abstract Base Classes. The issue does not name files, tests, entry points, or a concrete acceptance criterion; define those boundaries and a successful interoperability example before implementation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, rust
- Domain
- api, backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100