Returns the *o* converted to an integer object on success, or *NULL* on
failure. This is the equivalent of the Python expression ``int(o)``.
+ .. note::
+
+ This function is defined in the transitional :file:`intobject.h`
+ header file. It will be removed completely in Python 3.1. Use
+ the :cfunc:`PyNumber_Long` function instead.
+
.. cfunction:: PyObject* PyNumber_Long(PyObject *o)
is cleared and the value is clipped.
*/
- #define PyNumber_Int PyNumber_Long
+ /*
+ PyNumber_Int used to be found here. It's now in Include/intobject.h,
+ where it is defined to be an alias for PyNumber_Long. New code
+ should use PyNumber_Long instead.
+ */
PyAPI_FUNC(PyObject *) PyNumber_Long(PyObject *o);
/* Integer object interface
- This header files exists to make porting code to Python 3.0 easier. It
- defines aliases from PyInt_* to PyLong_*. Only PyInt_GetMax() and
- PyInt_CheckExact() remain in longobject.h.
+ This header file exists to make porting code to Python 3.0 easier. It
+ defines aliases from PyInt_* to PyLong_* and an alias from
+ PyNumber_Int to PyNumber_Long.
*/
#ifndef Py_INTOBJECT_H
#define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
#define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
#define PyInt_AS_LONG PyLong_AS_LONG
+#define PyNumber_Int PyNumber_Long
#ifdef __cplusplus
}