mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
bpo-29867: Add asserts in PyTuple_GET_SIZE, PyList_GET_SIZE and PySet_GET_SIZE. (#751)
This commit is contained in:
parent
a36e939aeb
commit
1a5856bf92
4 changed files with 4 additions and 4 deletions
|
@ -71,7 +71,7 @@ PyAPI_FUNC(void) _PyList_DebugMallocStats(FILE *out);
|
|||
#ifndef Py_LIMITED_API
|
||||
#define PyList_GET_ITEM(op, i) (((PyListObject *)(op))->ob_item[i])
|
||||
#define PyList_SET_ITEM(op, i, v) (((PyListObject *)(op))->ob_item[i] = (v))
|
||||
#define PyList_GET_SIZE(op) Py_SIZE(op)
|
||||
#define PyList_GET_SIZE(op) (assert(PyList_Check(op)),Py_SIZE(op))
|
||||
#define _PyList_ITEMS(op) (((PyListObject *)(op))->ob_item)
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue