From: Stefan Behnel Date: Sat, 25 Oct 2008 11:11:59 +0000 (+0200) Subject: Py2.4 requires some more definitions for the set type X-Git-Tag: 0.9.9.2.beta~23 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=497af27e800b17013fd88d747fd5124c1b7069a7;p=cython.git Py2.4 requires some more definitions for the set type --- diff --git a/Cython/Compiler/Builtin.py b/Cython/Compiler/Builtin.py index 60c2deaf..02b9f0a2 100644 --- a/Cython/Compiler/Builtin.py +++ b/Cython/Compiler/Builtin.py @@ -169,7 +169,14 @@ py23_set_utility_code = [""" ((ob)->ob_type == ((PyTypeObject*)&PySet_Type) || \ (ob)->ob_type == ((PyTypeObject*)&PyFrozenSet_Type)) -#define PySet_Pop(set) PyObject_CallMethod(set, "pop", NULL) +#define PySet_New(iterable) \ + PyObject_CallFunctionObjArgs((PyObject *)PySet_Type, iterable, NULL) +#define Pyx_PyFrozenSet_New(iterable) \ + PyObject_CallFunctionObjArgs((PyObject *)PyFrozenSet_Type, iterable, NULL) + +#define PySet_Size(anyset) PyObject_Size(anyset) +#define PySet_Contains(anyset, key) PySequence_Contains(anyset, key) +#define PySet_Pop(set) PyObject_CallMethod(set, "pop", NULL) static INLINE int PySet_Clear(PyObject *set) { PyObject *ret = PyObject_CallMethod(set, "clear", NULL); @@ -205,14 +212,6 @@ static PyTypeObject *PyFrozenSet_Type = NULL; #define PyFrozenSet_CheckExact(ob) ((ob)->ob_type == &PyFrozenSet_Type) -#define PySet_New(iterable) \ - PyObject_CallFunctionObjArgs((PyObject *)PySet_Type, iterable, NULL) -#define Pyx_PyFrozenSet_New(iterable) \ - PyObject_CallFunctionObjArgs((PyObject *)PyFrozenSet_Type, iterable, NULL) - -#define PySet_Size(anyset) PyObject_Size(anyset) -#define PySet_Contains(anyset, key) PySequence_Contains(anyset, key) - /* ---------------------------------------------------------------- */ static int __Pyx_Py23SetsImport(void) {