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
C/API - Document exceptions #51282
Comments
It would be nice to have an obvious/simple way to document C exceptions Something along: PyObject *PyErr_Create(char *name, const char *doc) PyObject *PyErr_Create2(char *name, const char *doc, PyObject *base) for py3k the signatures would be:
PyObject *PyErr_Create(const char *name, const char *doc)
PyObject *PyErr_Create2(const char *name, const char *doc, PyObject *base) Internally, these functions would pass a dict to PyErr_NewException with If there is support for this, I can provide patches for trunk and py3k. |
First attempt at implementing this. |
The same against py3k |
Sounds like a useful new API. Two comments:
|
Even though I don't fully agree with your comments here is a second For the record, I think that the signature difference is enough to But, hey, I'm happy if this gets in (in any form :). |
Same as previous against py3k |
Is there any chance that this will make it in? |
Since it's a new CAPI I think it should probably be discussed briefly on |
So do I. |
Also, what about tests? |
Funnily, I already did ask on python-dev, and only got one (+1) answer |
Yes, I'd say that counts as a brief discussion :) |
One nitpick: Python/errors.c uses tabs for indentation, your patch |
patch against trunk:
|
The same with a simpler test. |
Thanks for the patch! I rewrote the C function a bit to also take a dict |
Great! |
lekma, this patch is now listed in the 2.7 "what's new" document as |
Nope, that's ok (it's perfect). |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: