Pickle support for `PyErr`
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 16.2k
- Forks
- 1k
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 66
Description
Pickle support was already discussed in #100, customizing __setstate__, __getstate__ and __getnewargs_ex__ works well for customized pyclass.
Unfortunately, when we want to create customized exception using create_exception, it's hard to implement such methods. It seems that the arguments are stored in PyErr instead of the class itself, how can we implement these magic methods ourselves?
#[pyclass(extends=PyException, subclass)]
pub struct Error;
Of course, it's better for pyo3 to support these methods directly on PyErr. I'd like to help if there is a consensus to do that.
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 the prior discussion in issue #100 and the PyErr and create_exception behavior described here. Clarify how customized exception state and pickle methods should work, then establish the expected behavior and tests before implementation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, rust
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100