mirror of
https://github.com/python/cpython.git
synced 2024-11-26 03:14:27 +08:00
Fix in trailing comment: PyDict_SetItemString() does *not* consume a reference
count, PyList_SetItem() does. Very confusing!
This commit is contained in:
parent
aee0bad0a5
commit
49bb0e32a0
@ -461,9 +461,8 @@ quickly. Thus, to retrieve an object and store it again, the caller
|
||||
must call Py_INCREF() explicitly.
|
||||
|
||||
NOTE: functions that 'consume' a reference count like
|
||||
PyDict_SetItemString() even
|
||||
consume the reference if the object wasn't stored, to simplify error
|
||||
handling.
|
||||
PyList_SetItemString() even consume the reference if the object wasn't
|
||||
stored, to simplify error handling.
|
||||
|
||||
It seems attractive to make other functions that take an object as
|
||||
argument consume a reference count; however this may quickly get
|
||||
|
Loading…
Reference in New Issue
Block a user