summaryrefslogtreecommitdiffstats
path: root/Objects/longobject.c
diff options
context:
space:
mode:
authorMark Dickinson <mdickinson@enthought.com>2020-05-27 12:43:17 (GMT)
committerGitHub <noreply@github.com>2020-05-27 12:43:17 (GMT)
commit20941de0ddc39ce9f07e29b4cc770e8a9ef14d41 (patch)
tree1bac61590f58408a6500f7f8bb9955200b6f240f /Objects/longobject.c
parentfeb0846c3a28b05b4cfbc6ab34c764957f3eff55 (diff)
downloadcpython-20941de0ddc39ce9f07e29b4cc770e8a9ef14d41.zip
cpython-20941de0ddc39ce9f07e29b4cc770e8a9ef14d41.tar.gz
cpython-20941de0ddc39ce9f07e29b4cc770e8a9ef14d41.tar.bz2
bpo-37999: Fix outdated __int__ and nb_int references in comments (GH-20449)
* Fix outdated __int__ and nb_int references in comments * Also update C-API documentation * Add back missing 'method' word * Remove .. deprecated notices
Diffstat (limited to 'Objects/longobject.c')
-rw-r--r--Objects/longobject.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/Objects/longobject.c b/Objects/longobject.c
index a409948..e040d6c 100644
--- a/Objects/longobject.c
+++ b/Objects/longobject.c
@@ -363,7 +363,7 @@ PyLong_FromDouble(double dval)
#define PY_ABS_LONG_MIN (0-(unsigned long)LONG_MIN)
#define PY_ABS_SSIZE_T_MIN (0-(size_t)PY_SSIZE_T_MIN)
-/* Get a C long int from an int object or any object that has an __int__
+/* Get a C long int from an int object or any object that has an __index__
method.
On overflow, return -1 and set *overflow to 1 or -1 depending on the sign of
@@ -382,7 +382,7 @@ PyLong_AsLongAndOverflow(PyObject *vv, int *overflow)
long res;
Py_ssize_t i;
int sign;
- int do_decref = 0; /* if nb_int was called */
+ int do_decref = 0; /* if PyNumber_Index was called */
*overflow = 0;
if (vv == NULL) {
@@ -449,7 +449,7 @@ PyLong_AsLongAndOverflow(PyObject *vv, int *overflow)
return res;
}
-/* Get a C long int from an int object or any object that has an __int__
+/* Get a C long int from an int object or any object that has an __index__
method. Return -1 and set an error if overflow occurs. */
long
@@ -466,7 +466,7 @@ PyLong_AsLong(PyObject *obj)
return result;
}
-/* Get a C int from an int object or any object that has an __int__
+/* Get a C int from an int object or any object that has an __index__
method. Return -1 and set an error if overflow occurs. */
int
@@ -1113,7 +1113,7 @@ PyLong_FromSsize_t(Py_ssize_t ival)
}
/* Get a C long long int from an int object or any object that has an
- __int__ method. Return -1 and set an error if overflow occurs. */
+ __index__ method. Return -1 and set an error if overflow occurs. */
long long
PyLong_AsLongLong(PyObject *vv)
@@ -1121,7 +1121,7 @@ PyLong_AsLongLong(PyObject *vv)
PyLongObject *v;
long long bytes;
int res;
- int do_decref = 0; /* if nb_int was called */
+ int do_decref = 0; /* if PyNumber_Index was called */
if (vv == NULL) {
PyErr_BadInternalCall();
@@ -1257,7 +1257,7 @@ PyLong_AsUnsignedLongLongMask(PyObject *op)
}
/* Get a C long long int from an int object or any object that has an
- __int__ method.
+ __index__ method.
On overflow, return -1 and set *overflow to 1 or -1 depending on the sign of
the result. Otherwise *overflow is 0.
@@ -1275,7 +1275,7 @@ PyLong_AsLongLongAndOverflow(PyObject *vv, int *overflow)
long long res;
Py_ssize_t i;
int sign;
- int do_decref = 0; /* if nb_int was called */
+ int do_decref = 0; /* if PyNumber_Index was called */
*overflow = 0;
if (vv == NULL) {