gh-150663: Document that PyErr_SetRaisedException() accepts NULL#150705
gh-150663: Document that PyErr_SetRaisedException() accepts NULL#150705philthompson10 wants to merge 187 commits into
PyErr_SetRaisedException() accepts NULL#150705Conversation
Documented that `PyErr_SetRaisedException()` accepts `NULL` as the value of the exception being set.
|
The following commit authors need to sign the Contributor License Agreement: |
Documentation build overview
122 files changed ·
|
| .. warning:: | ||
|
|
||
| This call steals a reference to *exc*, which must be a valid exception. | ||
| *exc* must be a valid exception (in which case a reference is stolen) or |
There was a problem hiding this comment.
The fact that it can be NULL should not be in a warning.
Removed the warning and expanded the main part of the explanation.
| A stolen reference to *exc* is set as the exception currently being raised, | ||
| clearing the existing exception if one is set. *exc* may be ``NULL`` in |
There was a problem hiding this comment.
Keep the warning, but only use it for the note about reference stealing. The sentence about exc being NULL should go in the body.
There was a problem hiding this comment.
I think that it is better to use note instead of warning, like in PyList_SetItem and many other functions that steal references.
I suggest to add "If exc is NULL, just clear the existing exception." to the body and replace warning with note.
|
On 03/06/2026 13:17, Peter Bierma wrote:
@ZeroIntensity commented on this pull request.
> + A stolen reference to *exc* is set as the exception currently
> being raised,
+ clearing the existing exception if one is set. *exc* may be
``NULL`` in
Keep the warning, but only use it for the note about reference
stealing. The sentence about `exc` being `NULL` should go in the body.
No other call in this section uses warnings for this information.
Specifically `PyErr_Restore()` includes it in the body.
|
|
…GH-150580) Co-authored-by: Charlie Lin <tuug@gmx.us> Co-authored-by: da-woods <dw-git@d-woods.co.uk> Co-authored-by: Stan Ulbrych <stan@python.org> Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
* Correct Stable ABI documentation for METH_FASTCALL The current documentation says: > > METH_FASTCALL > Part of the Stable ABI since version 3.7. > > [...] > > Added in version 3.7. > > Changed in version 3.10: METH_FASTCALL is now part of the stable ABI. so is contradictory about when it was added to the Stable ABI. Looking at the header it seems like 3.10 is right.
…es (python#133504) Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Savannah Ostrowski <savannah@python.org> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com> Co-authored-by: Brett Cannon <brett@python.org>
Removes some stray commas in help text.
Following on from pythonGH-132291 this is the second part of the patch from https://bugs.debian.org/1101406 This tweaks the formatting of a few bits of the manpage.
…ython#148846) There are propositions to add a single-quote-double-quote switch (pythongh-90630), so to avoid hiccups of people passing `force` as a positional and it being used for the single-double switch, we make kwargs kwargs-only. Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
Co-authored-by: Stan Ulbrych <stan@python.org>
|
@philthompson10 For next time: please don't rebase or force push PRs. We squash merge at the end, and it's easier to review without force pushes. Also force pushes can end up spamming all the CODEOWNERS. If the branch is out of date with https://devguide.python.org/getting-started/pull-request-lifecycle/#don-t-force-push |
Documented that
PyErr_SetRaisedException()acceptsNULLas the value of the exception being set.PyErr_SetRaisedException()accepts NULL #150663