summaryrefslogtreecommitdiffstats
path: root/Include/listobject.h
diff options
context:
space:
mode:
authorMartin v. Löwis <martin@v.loewis.de>2007-07-21 06:55:02 (GMT)
committerMartin v. Löwis <martin@v.loewis.de>2007-07-21 06:55:02 (GMT)
commit6819210b9e4e5719a6f7f9c1725f8fa70a8936f6 (patch)
tree456e2e6b3d9d71e966f3b0e419ecfe44ce3c1fdd /Include/listobject.h
parentb1994b4a5d0139a010eb0af1d6615a3df92fe786 (diff)
downloadcpython-6819210b9e4e5719a6f7f9c1725f8fa70a8936f6.zip
cpython-6819210b9e4e5719a6f7f9c1725f8fa70a8936f6.tar.gz
cpython-6819210b9e4e5719a6f7f9c1725f8fa70a8936f6.tar.bz2
PEP 3123: Provide forward compatibility with Python 3.0, while keeping
backwards compatibility. Add Py_Refcnt, Py_Type, Py_Size, and PyVarObject_HEAD_INIT.
Diffstat (limited to 'Include/listobject.h')
-rw-r--r--Include/listobject.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/Include/listobject.h b/Include/listobject.h
index db3124e..e8b192a 100644
--- a/Include/listobject.h
+++ b/Include/listobject.h
@@ -41,8 +41,8 @@ typedef struct {
PyAPI_DATA(PyTypeObject) PyList_Type;
#define PyList_Check(op) \
- PyType_FastSubclass((op)->ob_type, Py_TPFLAGS_LIST_SUBCLASS)
-#define PyList_CheckExact(op) ((op)->ob_type == &PyList_Type)
+ PyType_FastSubclass(Py_Type(op), Py_TPFLAGS_LIST_SUBCLASS)
+#define PyList_CheckExact(op) (Py_Type(op) == &PyList_Type)
PyAPI_FUNC(PyObject *) PyList_New(Py_ssize_t size);
PyAPI_FUNC(Py_ssize_t) PyList_Size(PyObject *);
@@ -60,7 +60,7 @@ PyAPI_FUNC(PyObject *) _PyList_Extend(PyListObject *, PyObject *);
/* Macro, trading safety for speed */
#define PyList_GET_ITEM(op, i) (((PyListObject *)(op))->ob_item[i])
#define PyList_SET_ITEM(op, i, v) (((PyListObject *)(op))->ob_item[i] = (v))
-#define PyList_GET_SIZE(op) (((PyListObject *)(op))->ob_size)
+#define PyList_GET_SIZE(op) Py_Size(op)
#ifdef __cplusplus
}