diff options
author | Jeremy Hylton <jeremy@alum.mit.edu> | 2000-07-12 12:56:19 (GMT) |
---|---|---|
committer | Jeremy Hylton <jeremy@alum.mit.edu> | 2000-07-12 12:56:19 (GMT) |
commit | 6253f83b0a2d261024cd5ef84d2e36fe4f4f1f3d (patch) | |
tree | 3a2320c46c024dd289462d3c5d61129c89311ffb /Objects | |
parent | f981c8f9151eb7a6d6851c6b7f46a4c3e7619f15 (diff) | |
download | cpython-6253f83b0a2d261024cd5ef84d2e36fe4f4f1f3d.zip cpython-6253f83b0a2d261024cd5ef84d2e36fe4f4f1f3d.tar.gz cpython-6253f83b0a2d261024cd5ef84d2e36fe4f4f1f3d.tar.bz2 |
change abstract size functions PySequence_Size &c.
add macros for backwards compatibility with C source
Diffstat (limited to 'Objects')
-rw-r--r-- | Objects/abstract.c | 16 | ||||
-rw-r--r-- | Objects/object.c | 2 |
2 files changed, 9 insertions, 9 deletions
diff --git a/Objects/abstract.c b/Objects/abstract.c index 5717815..2c7c307 100644 --- a/Objects/abstract.c +++ b/Objects/abstract.c @@ -62,7 +62,7 @@ PyObject_Type(PyObject *o) } int -PyObject_Length(PyObject *o) +PyObject_Size(PyObject *o) { PySequenceMethods *m; @@ -75,7 +75,7 @@ PyObject_Length(PyObject *o) if (m && m->sq_length) return m->sq_length(o); - return PyMapping_Length(o); + return PyMapping_Size(o); } PyObject * @@ -803,7 +803,7 @@ PySequence_Check(PyObject *s) } int -PySequence_Length(PyObject *s) +PySequence_Size(PyObject *s) { PySequenceMethods *m; @@ -1036,7 +1036,7 @@ PySequence_Tuple(PyObject *v) if (m && m->sq_item) { int i; PyObject *t; - int n = PySequence_Length(v); + int n = PySequence_Size(v); if (n < 0) return NULL; t = PyTuple_New(n); @@ -1087,7 +1087,7 @@ PySequence_List(PyObject *v) if (m && m->sq_item) { int i; PyObject *l; - int n = PySequence_Length(v); + int n = PySequence_Size(v); if (n < 0) return NULL; l = PyList_New(n); @@ -1152,7 +1152,7 @@ PySequence_Count(PyObject *s, PyObject *o) return -1; } - l = PySequence_Length(s); + l = PySequence_Size(s); if (l < 0) return -1; @@ -1232,7 +1232,7 @@ PySequence_Index(PyObject *s, PyObject *o) return -1; } - l = PySequence_Length(s); + l = PySequence_Size(s); if (l < 0) return -1; @@ -1261,7 +1261,7 @@ PyMapping_Check(PyObject *o) } int -PyMapping_Length(PyObject *o) +PyMapping_Size(PyObject *o) { PyMappingMethods *m; diff --git a/Objects/object.c b/Objects/object.c index 9194c90..0c50175 100644 --- a/Objects/object.c +++ b/Objects/object.c @@ -958,7 +958,7 @@ PyTypeObject *_Py_cobject_hack = &PyCObject_Type; /* Hack to force loading of abstract.o */ -int (*_Py_abstract_hack)(PyObject *) = &PyObject_Length; +int (*_Py_abstract_hack)(PyObject *) = &PyObject_Size; /* Python's malloc wrappers (see mymalloc.h) */ |