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

Skip to content

Commit 49bb0e3

Browse files
committed
Fix in trailing comment: PyDict_SetItemString() does *not* consume a reference
count, PyList_SetItem() does. Very confusing!
1 parent aee0bad commit 49bb0e3

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

Include/object.h

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -461,9 +461,8 @@ quickly. Thus, to retrieve an object and store it again, the caller
461461
must call Py_INCREF() explicitly.
462462
463463
NOTE: functions that 'consume' a reference count like
464-
PyDict_SetItemString() even
465-
consume the reference if the object wasn't stored, to simplify error
466-
handling.
464+
PyList_SetItemString() even consume the reference if the object wasn't
465+
stored, to simplify error handling.
467466
468467
It seems attractive to make other functions that take an object as
469468
argument consume a reference count; however this may quickly get

0 commit comments

Comments
 (0)