Go to the documentation of this file.
11 #include <patchlevel.h>
13 #if PY_MAJOR_VERSION >= 3
17 #define PyClass_Check(object) \
18 PyObject_IsInstance (object, reinterpret_cast<PyObject *> (&PyType_Type))
22 #define Py_FindMethod(methods, self, name) \
23 PyObject_GenericGetAttr(self, PyBytes_FromString(name))
30 #define PyString_Check(str) PyBytes_Check(str)
31 #define PyString_FromString(str) PyBytes_FromString(str)
32 #define PyString_AsString(obj) PyBytes_AsString(obj)
33 #define PyString_AsStringAndSize(obj, str, len) PyBytes_AsStringAndSize(obj, str, len)
36 #define PyInt_Check(x) PyLong_Check(x)
37 #define PyInt_AsLong(x) PyLong_AsLong(x)
38 #define PyInt_AS_LONG(x) PyLong_AsLong(x)
39 #define PyInt_AsSsize_t(x) PyLong_AsSsize_t(x)
40 #define PyInt_FromLong(x) PyLong_FromLong(x)
45 #define Py_TPFLAGS_CHECKTYPES Py_TPFLAGS_DEFAULT
46 #define Py_TPFLAGS_HAVE_RICHCOMPARE Py_TPFLAGS_DEFAULT
50 #define PYUTIL_OBJECT_REPR(obj) PyObject_Str (PyObject_Repr (obj))
56 #define PYUTIL_OBJECT_REPR(obj) PyObject_Repr (obj)
60 #endif // _PyImathAPI_h_