[Python-checkins] python/dist/src/Include listobject.h,2.28,2.29

tim_one at users.sourceforge.net tim_one at users.sourceforge.net
Thu Jul 29 05:29:17 CEST 2004


Update of /cvsroot/python/python/dist/src/Include
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22000/Include

Modified Files:
	listobject.h 
Log Message:
Document what the members of PyListObject are used for, and the crucial
invariants they must satisfy.


Index: listobject.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Include/listobject.h,v
retrieving revision 2.28
retrieving revision 2.29
diff -C2 -d -r2.28 -r2.29
*** listobject.h	11 Mar 2004 09:13:12 -0000	2.28
--- listobject.h	29 Jul 2004 03:29:15 -0000	2.29
***************
*** 22,26 ****
--- 22,35 ----
  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;



More information about the Python-checkins mailing list