diff options
author | Tim Peters <tim.peters@gmail.com> | 2004-07-29 03:29:15 (GMT) |
---|---|---|
committer | Tim Peters <tim.peters@gmail.com> | 2004-07-29 03:29:15 (GMT) |
commit | a995a2dd54f904913bfde54317480edf3a3b79c8 (patch) | |
tree | 04eba7f447330044c3568dc4dba6fa873f25c982 /Include | |
parent | b38e2b61b3ea0556e3bec0e83ba027a7a3371df8 (diff) | |
download | cpython-a995a2dd54f904913bfde54317480edf3a3b79c8.zip cpython-a995a2dd54f904913bfde54317480edf3a3b79c8.tar.gz cpython-a995a2dd54f904913bfde54317480edf3a3b79c8.tar.bz2 |
Document what the members of PyListObject are used for, and the crucial
invariants they must satisfy.
Diffstat (limited to 'Include')
-rw-r--r-- | Include/listobject.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Include/listobject.h b/Include/listobject.h index b4935ae..62a8518 100644 --- a/Include/listobject.h +++ b/Include/listobject.h @@ -21,7 +21,16 @@ extern "C" { typedef struct { PyObject_VAR_HEAD + /* Vector of pointers to list elements. list[0] is ob_item{0], etc. */ 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; } PyListObject; |