-
Notifications
You must be signed in to change notification settings - Fork 784
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
Add exceptions to modules #732
Comments
Possibly one for the new syntax proposed in #694 . (Seems like |
@davidhewitt you mean something like: #[pymodule]
mod my_mod {
#[pyexception]
enum MyException { ... }
...
} |
Quite possibly, yes. Or also something along the lines of
|
Oh! I really like that! |
Just wanted to mention that I needed this exact use case, and it would have been more straightforward for me if |
@hwchen thanks for the offer but I'm about to rework |
(In the end @birkenfeld did end up submitting this exact PR... many thanks! Also, I've suggested we push the |
Noticing this continues to get pushed to further releases. Let us know if help is desired, we can follow the design you have envisioned. And officially, <bump/> |
@jnicholls thanks for the interest, help is very welcome. The design which I prefer at the moment is to make This is already possible today, but it's not the most user-friendly or well documented. For the remaining work, see #295 (comment) If you're interested in coming along with ideas and implementation, I'd be really happy to see this complete! I've been busy working on other pieces of pyo3 😅 |
After creating a new exception using:
It is natural that I would want to make it available as an import within my python module:
However, in order to do this, I had to do some deep Kung Foo action:
It would be nice to have an easier API for this:
The text was updated successfully, but these errors were encountered: