We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent eff45c9 commit dabf0f2Copy full SHA for dabf0f2
Doc/c-api/module.rst
@@ -496,9 +496,6 @@ state:
496
497
On success, return ``0``. On error, raise an exception and return ``-1``.
498
499
- Return ``-1`` if *value* is ``NULL``. It must be called with an exception
500
- raised in this case.
501
-
502
Example usage::
503
504
static int
@@ -513,6 +510,10 @@ state:
513
510
return res;
514
511
}
515
512
+ To be convenient, the function accepts ``NULL`` *value* with an exception
+ set. In this case, return ``-1`` and just leave the raised exception
+ unchanged.
516
+
517
The example can also be written without checking explicitly if *obj* is
518
``NULL``::
519
0 commit comments