diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2018-05-22 08:02:44 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-05-22 08:02:44 (GMT) |
commit | f5b1183610d5888db3bbd639b1a0c945dbd8f8dd (patch) | |
tree | 52e6ba29f4452c01ac73ebd53bf6f64d2092b95b /Include | |
parent | 268cc7c3f8f58075b42ff0cd6b6c6c5d76044895 (diff) | |
download | cpython-f5b1183610d5888db3bbd639b1a0c945dbd8f8dd.zip cpython-f5b1183610d5888db3bbd639b1a0c945dbd8f8dd.tar.gz cpython-f5b1183610d5888db3bbd639b1a0c945dbd8f8dd.tar.bz2 |
bpo-5945: Improve mappings and sequences C API docs. (GH-7029)
Diffstat (limited to 'Include')
-rw-r--r-- | Include/abstract.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Include/abstract.h b/Include/abstract.h index 3133cd1..4088f75 100644 --- a/Include/abstract.h +++ b/Include/abstract.h @@ -442,13 +442,14 @@ PyAPI_FUNC(PyObject *) PyObject_GetItem(PyObject *o, PyObject *key); This is the equivalent of the Python statement: o[key]=v. */ PyAPI_FUNC(int) PyObject_SetItem(PyObject *o, PyObject *key, PyObject *v); -/* Remove the mapping for object, key, from the object 'o'. +/* Remove the mapping for the string 'key' from the object 'o'. Returns -1 on failure. This is equivalent to the Python statement: del o[key]. */ PyAPI_FUNC(int) PyObject_DelItemString(PyObject *o, const char *key); -/* Delete the mapping for key from object 'o'. Returns -1 on failure. +/* Delete the mapping for the object 'key' from the object 'o'. + Returns -1 on failure. This is the equivalent of the Python statement: del o[key]. */ PyAPI_FUNC(int) PyObject_DelItem(PyObject *o, PyObject *key); @@ -1005,8 +1006,7 @@ PyAPI_FUNC(PyObject *) PySequence_InPlaceRepeat(PyObject *o, Py_ssize_t count); PyAPI_FUNC(int) PyMapping_Check(PyObject *o); /* Returns the number of keys in mapping object 'o' on success, and -1 on - failure. For objects that do not provide sequence protocol, this is - equivalent to the Python expression: len(o). */ + failure. This is equivalent to the Python expression: len(o). */ PyAPI_FUNC(Py_ssize_t) PyMapping_Size(PyObject *o); /* For DLL compatibility */ @@ -1019,7 +1019,7 @@ PyAPI_FUNC(Py_ssize_t) PyMapping_Length(PyObject *o); int PyMapping_DelItemString(PyObject *o, const char *key); - Remove the mapping for object 'key' from the mapping 'o'. Returns -1 on + Remove the mapping for the string 'key' from the mapping 'o'. Returns -1 on failure. This is equivalent to the Python statement: del o[key]. */ @@ -1029,7 +1029,7 @@ PyAPI_FUNC(Py_ssize_t) PyMapping_Length(PyObject *o); int PyMapping_DelItem(PyObject *o, PyObject *key); - Remove the mapping for object 'key' from the mapping object 'o'. + Remove the mapping for the object 'key' from the mapping object 'o'. Returns -1 on failure. This is equivalent to the Python statement: del o[key]. */ @@ -1063,13 +1063,13 @@ PyAPI_FUNC(PyObject *) PyMapping_Values(PyObject *o); NULL. */ PyAPI_FUNC(PyObject *) PyMapping_Items(PyObject *o); -/* Return element of o corresponding to the object, key, or NULL on failure. +/* Return element of 'o' corresponding to the string 'key' or NULL on failure. This is the equivalent of the Python expression: o[key]. */ PyAPI_FUNC(PyObject *) PyMapping_GetItemString(PyObject *o, const char *key); -/* Map the object 'key' to the value 'v' in the mapping 'o'. +/* Map the string 'key' to the value 'v' in the mapping 'o'. Returns -1 on failure. This is the equivalent of the Python statement: o[key]=v. */ |