summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Doc/c-api/number.rst11
-rw-r--r--Include/abstract.h10
-rw-r--r--Objects/typeobject.c2
3 files changed, 7 insertions, 16 deletions
diff --git a/Doc/c-api/number.rst b/Doc/c-api/number.rst
index bb72119..d11e3b1 100644
--- a/Doc/c-api/number.rst
+++ b/Doc/c-api/number.rst
@@ -230,19 +230,16 @@ Number Protocol
.. cfunction:: PyObject* PyNumber_Int(PyObject *o)
- .. index:: builtin: int
-
- Returns the *o* converted to an integer object on success, or *NULL* on failure.
- If the argument is outside the integer range a long object will be returned
- instead. This is the equivalent of the Python expression ``int(o)``.
+ Returns the *o* converted to an integer object on success, or *NULL* on
+ failure. This is the equivalent of the Python expression ``int(o)``.
.. cfunction:: PyObject* PyNumber_Long(PyObject *o)
- .. index:: builtin: long
+ .. index:: builtin: int
Returns the *o* converted to an integer object on success, or *NULL* on
- failure. This is the equivalent of the Python expression ``long(o)``.
+ failure. This is the equivalent of the Python expression ``int(o)``.
.. cfunction:: PyObject* PyNumber_Float(PyObject *o)
diff --git a/Include/abstract.h b/Include/abstract.h
index 0bbcee5..4fb16d0 100644
--- a/Include/abstract.h
+++ b/Include/abstract.h
@@ -808,20 +808,14 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
#define PyNumber_Int PyNumber_Long
+ PyAPI_FUNC(PyObject *) PyNumber_Long(PyObject *o);
+
/*
Returns the o converted to an integer object on success, or
NULL on failure. This is the equivalent of the Python
expression: int(o).
*/
- PyAPI_FUNC(PyObject *) PyNumber_Long(PyObject *o);
-
- /*
- Returns the o converted to a long integer object on success,
- or NULL on failure. This is the equivalent of the Python
- expression: long(o).
- */
-
PyAPI_FUNC(PyObject *) PyNumber_Float(PyObject *o);
/*
diff --git a/Objects/typeobject.c b/Objects/typeobject.c
index b6ffe92..8f2e01e 100644
--- a/Objects/typeobject.c
+++ b/Objects/typeobject.c
@@ -5444,7 +5444,7 @@ static slotdef slotdefs[] = {
UNSLOT("__int__", nb_int, slot_nb_int, wrap_unaryfunc,
"int(x)"),
UNSLOT("__long__", nb_long, slot_nb_long, wrap_unaryfunc,
- "long(x)"),
+ "int(x)"),
UNSLOT("__float__", nb_float, slot_nb_float, wrap_unaryfunc,
"float(x)"),
NBSLOT("__index__", nb_index, slot_nb_index, wrap_unaryfunc,