Skip to content

Commit eb0f95c

Browse files
committed
Merged revisions 69517 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k ........ r69517 | mark.dickinson | 2009-02-11 17:04:37 +0000 (Wed, 11 Feb 2009) | 2 lines Issue python#4910: PyNumber_Int is deprecated in 3.0.1; will be removed in 3.1. ........
1 parent 9ab8670 commit eb0f95c

3 files changed

Lines changed: 15 additions & 4 deletions

File tree

Doc/c-api/number.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,12 @@ Number Protocol
233233
Returns the *o* converted to an integer object on success, or *NULL* on
234234
failure. This is the equivalent of the Python expression ``int(o)``.
235235

236+
.. note::
237+
238+
This function is defined in the transitional :file:`intobject.h`
239+
header file. It will be removed completely in Python 3.1. Use
240+
the :cfunc:`PyNumber_Long` function instead.
241+
236242

237243
.. cfunction:: PyObject* PyNumber_Long(PyObject *o)
238244

Include/abstract.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,11 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
783783
is cleared and the value is clipped.
784784
*/
785785

786-
#define PyNumber_Int PyNumber_Long
786+
/*
787+
PyNumber_Int used to be found here. It's now in Include/intobject.h,
788+
where it is defined to be an alias for PyNumber_Long. New code
789+
should use PyNumber_Long instead.
790+
*/
787791

788792
PyAPI_FUNC(PyObject *) PyNumber_Long(PyObject *o);
789793

Include/intobject.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
/* Integer object interface
22
3-
This header files exists to make porting code to Python 3.0 easier. It
4-
defines aliases from PyInt_* to PyLong_*. Only PyInt_GetMax() and
5-
PyInt_CheckExact() remain in longobject.h.
3+
This header file exists to make porting code to Python 3.0 easier. It
4+
defines aliases from PyInt_* to PyLong_* and an alias from
5+
PyNumber_Int to PyNumber_Long.
66
*/
77

88
#ifndef Py_INTOBJECT_H
@@ -28,6 +28,7 @@ extern "C" {
2828
#define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
2929
#define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
3030
#define PyInt_AS_LONG PyLong_AS_LONG
31+
#define PyNumber_Int PyNumber_Long
3132

3233
#ifdef __cplusplus
3334
}

0 commit comments

Comments
 (0)