summaryrefslogtreecommitdiffstats
path: root/Include/sliceobject.h
diff options
context:
space:
mode:
authorArmin Rigo <arigo@tunes.org>2004-10-28 16:32:00 (GMT)
committerArmin Rigo <arigo@tunes.org>2004-10-28 16:32:00 (GMT)
commit89a39461bff04b80bb4857790350e1ab30ff2df9 (patch)
tree54bc00a9ad30e8e49849874cfbca8543de62fa58 /Include/sliceobject.h
parent063e1e846dc5c3fe593cef5b14cc429369dcd2c2 (diff)
downloadcpython-89a39461bff04b80bb4857790350e1ab30ff2df9.zip
cpython-89a39461bff04b80bb4857790350e1ab30ff2df9.tar.gz
cpython-89a39461bff04b80bb4857790350e1ab30ff2df9.tar.bz2
Wrote down the invariants of some common objects whose structure is
exposed in header files. Fixed a few comments in these headers. As we might have expected, writing down invariants systematically exposed a (minor) bug. In this case, function objects have a writeable func_code attribute, which could be set to code objects with the wrong number of free variables. Calling the resulting function segfaulted the interpreter. Added a corresponding test.
Diffstat (limited to 'Include/sliceobject.h')
-rw-r--r--Include/sliceobject.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/Include/sliceobject.h b/Include/sliceobject.h
index 1fb123a..fc80254 100644
--- a/Include/sliceobject.h
+++ b/Include/sliceobject.h
@@ -16,12 +16,12 @@ PyAPI_DATA(PyObject) _Py_EllipsisObject; /* Don't use this directly */
A slice object containing start, stop, and step data members (the
names are from range). After much talk with Guido, it was decided to
-let these be any arbitrary python type.
+let these be any arbitrary python type. Py_None stands for omitted values.
*/
typedef struct {
PyObject_HEAD
- PyObject *start, *stop, *step;
+ PyObject *start, *stop, *step; /* not NULL */
} PySliceObject;
PyAPI_DATA(PyTypeObject) PySlice_Type;