mirror of
https://github.com/python/cpython.git
synced 2025-10-09 16:34:44 +00:00
bpo-5945: Improve mappings and sequences C API docs. (GH-7029)
(cherry picked from commit f5b1183610
)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
parent
d9055f8176
commit
e1a78cacf6
5 changed files with 101 additions and 76 deletions
|
@ -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. */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue