Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9a18a7e

Browse files
committed
Document Pyerr_Warn().
Add an XXX comment at the beginning expressing disappointment over the confusing way refcount behavior of arguments is documented.
1 parent 3dbb406 commit 9a18a7e

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

Doc/api/refcounts.dat

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,13 @@
2121
# always return NULL. This is used by some of the PyErr_*() functions, in
2222
# particular.
2323

24+
# XXX NOTE: the 0/+1/-1 refcount information for arguments is
25+
# confusing! Much more useful would be to indicate whether the
26+
# function "steals" a reference to the argument or not. Take for
27+
# example PyList_SetItem(list, i, item). This lists as a 0 change for
28+
# both the list and the item arguments. However, in fact it steals a
29+
# reference to the item argument!
30+
2431
# The parameter names are as they appear in the API manual, not the source
2532
# code.
2633

@@ -199,6 +206,10 @@ PyErr_Format:PyObject*:exception:+1:
199206
PyErr_Format:char*:format::
200207
PyErr_Format::...::
201208

209+
PyErr_Warn:int:::
210+
PyErr_Warn:PyObject*:category:0 or +1:
211+
PyErr_Warn:char*:message::
212+
202213
PyEval_AcquireLock:void:::
203214

204215
PyEval_AcquireThread:void:::

0 commit comments

Comments
 (0)