diff options
author | Jeremy Hylton <jeremy@alum.mit.edu> | 2000-07-12 12:56:19 +0000 |
---|---|---|
committer | Jeremy Hylton <jeremy@alum.mit.edu> | 2000-07-12 12:56:19 +0000 |
commit | 6253f83b0a2d261024cd5ef84d2e36fe4f4f1f3d (patch) | |
tree | 3a2320c46c024dd289462d3c5d61129c89311ffb /Include/abstract.h | |
parent | Add "exceptions" to list of built-in modules for the sake of (diff) | |
download | cpython-6253f83b0a2d261024cd5ef84d2e36fe4f4f1f3d.tar.gz cpython-6253f83b0a2d261024cd5ef84d2e36fe4f4f1f3d.tar.bz2 cpython-6253f83b0a2d261024cd5ef84d2e36fe4f4f1f3d.zip |
change abstract size functions PySequence_Size &c.
add macros for backwards compatibility with C source
Diffstat (limited to 'Include/abstract.h')
-rw-r--r-- | Include/abstract.h | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/Include/abstract.h b/Include/abstract.h index 6b96adf6c1d..d1a1db3f63b 100644 --- a/Include/abstract.h +++ b/Include/abstract.h @@ -381,11 +381,13 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ equivalent to the Python expression: type(o). */ - DL_IMPORT(int) PyObject_Length(PyObject *o); + DL_IMPORT(int) PyObject_Size(PyObject *o); + +#define PyObject_Length(O) PyObject_Size((O)) /* - Return the length of object o. If the object, o, provides - both sequence and mapping protocols, the sequence length is + Return the size of object o. If the object, o, provides + both sequence and mapping protocols, the sequence size is returned. On error, -1 is returned. This is the equivalent to the Python expression: len(o). @@ -681,10 +683,12 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ */ - DL_IMPORT(int) PySequence_Length(PyObject *o); + DL_IMPORT(int) PySequence_Size(PyObject *o); + +#define PySequence_Length(O) PySequence_Size((O)) /* - Return the length of sequence object o, or -1 on failure. + Return the size of sequence object o, or -1 on failure. */ @@ -833,7 +837,9 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/ This function always succeeds. */ - DL_IMPORT(int) PyMapping_Length(PyObject *o); + DL_IMPORT(int) PyMapping_Size(PyObject *o); + +#define PyMapping_Length(O) PyMapping_Size((O)) /* Returns the number of keys in object o on success, and -1 on |