mirror of
https://github.com/python/cpython.git
synced 2025-08-03 08:34:29 +00:00
Restore PyXXX_Length() APIs for binary compatibility.
New code will see the macros and therefore use the PyXXX_Size() APIs instead. By Thomas Wouters.
This commit is contained in:
parent
af36a3aa20
commit
cf5f358784
2 changed files with 42 additions and 6 deletions
|
@ -78,6 +78,14 @@ PyObject_Size(PyObject *o)
|
|||
return PyMapping_Size(o);
|
||||
}
|
||||
|
||||
#undef PyObject_Length
|
||||
int
|
||||
PyObject_Length(PyObject *o)
|
||||
{
|
||||
return PyObject_Size(o);
|
||||
}
|
||||
#define PyObject_Length PyObject_Size
|
||||
|
||||
PyObject *
|
||||
PyObject_GetItem(PyObject *o, PyObject *key)
|
||||
{
|
||||
|
@ -820,6 +828,14 @@ PySequence_Size(PyObject *s)
|
|||
return -1;
|
||||
}
|
||||
|
||||
#undef PySequence_Length
|
||||
int
|
||||
PySequence_Length(PyObject *s)
|
||||
{
|
||||
return PySequence_Size(s);
|
||||
}
|
||||
#define PySequence_Length PySequence_Size
|
||||
|
||||
PyObject *
|
||||
PySequence_Concat(PyObject *s, PyObject *o)
|
||||
{
|
||||
|
@ -1278,6 +1294,14 @@ PyMapping_Size(PyObject *o)
|
|||
return -1;
|
||||
}
|
||||
|
||||
#undef PyMapping_Length
|
||||
int
|
||||
PyMapping_Length(PyObject *o)
|
||||
{
|
||||
return PyMapping_Size(o);
|
||||
}
|
||||
#define PyMapping_Length PyMapping_Size
|
||||
|
||||
PyObject *
|
||||
PyMapping_GetItemString(PyObject *o, char *key)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue