]> granicus.if.org Git - python/commitdiff
Issue #4910: PyNumber_Int is deprecated in 3.0.1; will be removed in 3.1.
authorMark Dickinson <dickinsm@gmail.com>
Wed, 11 Feb 2009 17:04:37 +0000 (17:04 +0000)
committerMark Dickinson <dickinsm@gmail.com>
Wed, 11 Feb 2009 17:04:37 +0000 (17:04 +0000)
Doc/c-api/number.rst
Include/abstract.h
Include/intobject.h

index e7c5f61d62469e3e315eac05144cce86f54aa551..c8f69459330876b5337c96e77ece98c2091505f9 100644 (file)
@@ -233,6 +233,12 @@ Number Protocol
    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)
 
index f4e31c77c0c8b97264315268614ea98545efb34c..dd00a533c7e7e990e9989b8687c8d0c6cf181911 100644 (file)
@@ -784,7 +784,11 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
         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);
 
index 041c9f7c307a29fd48818692cb8bc66f458deb9a..e3147f49ae6bc49abc2831d01c720d63a693dfb2 100644 (file)
@@ -1,8 +1,8 @@
 /* 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
@@ -28,6 +28,7 @@ extern "C" {
 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
 #define PyInt_AS_LONG PyLong_AS_LONG
+#define PyNumber_Int PyNumber_Long
 
 #ifdef __cplusplus
 }