mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Document what the members of PyListObject are used for, and the crucial
invariants they must satisfy.
This commit is contained in:
parent
b38e2b61b3
commit
a995a2dd54
1 changed files with 9 additions and 0 deletions
|
@ -21,7 +21,16 @@ extern "C" {
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
PyObject_VAR_HEAD
|
PyObject_VAR_HEAD
|
||||||
|
/* Vector of pointers to list elements. list[0] is ob_item{0], etc. */
|
||||||
PyObject **ob_item;
|
PyObject **ob_item;
|
||||||
|
|
||||||
|
/* ob_item contains space for 'allocated' elements. The number
|
||||||
|
* currently in use is ob_size.
|
||||||
|
* Invariants:
|
||||||
|
* 0 <= ob_size <= allocated
|
||||||
|
* len(list) == ob_size
|
||||||
|
* ob_item == NULL implies ob_size == allocated == 0
|
||||||
|
*/
|
||||||
int allocated;
|
int allocated;
|
||||||
} PyListObject;
|
} PyListObject;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue