Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d746768

Browse files
committed
Issue #4910: replace "long" with "int" in docstring for __long__ slot and
in documentation for PyNumber_Long.
1 parent 30bf122 commit d746768

3 files changed

Lines changed: 7 additions & 16 deletions

File tree

Doc/c-api/number.rst

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -230,19 +230,16 @@ Number Protocol
230230

231231
.. cfunction:: PyObject* PyNumber_Int(PyObject *o)
232232

233-
.. index:: builtin: int
234-
235-
Returns the *o* converted to an integer object on success, or *NULL* on failure.
236-
If the argument is outside the integer range a long object will be returned
237-
instead. This is the equivalent of the Python expression ``int(o)``.
233+
Returns the *o* converted to an integer object on success, or *NULL* on
234+
failure. This is the equivalent of the Python expression ``int(o)``.
238235

239236

240237
.. cfunction:: PyObject* PyNumber_Long(PyObject *o)
241238

242-
.. index:: builtin: long
239+
.. index:: builtin: int
243240

244241
Returns the *o* converted to an integer object on success, or *NULL* on
245-
failure. This is the equivalent of the Python expression ``long(o)``.
242+
failure. This is the equivalent of the Python expression ``int(o)``.
246243

247244

248245
.. cfunction:: PyObject* PyNumber_Float(PyObject *o)

Include/abstract.h

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -808,20 +808,14 @@ xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx*/
808808

809809
#define PyNumber_Int PyNumber_Long
810810

811+
PyAPI_FUNC(PyObject *) PyNumber_Long(PyObject *o);
812+
811813
/*
812814
Returns the o converted to an integer object on success, or
813815
NULL on failure. This is the equivalent of the Python
814816
expression: int(o).
815817
*/
816818

817-
PyAPI_FUNC(PyObject *) PyNumber_Long(PyObject *o);
818-
819-
/*
820-
Returns the o converted to a long integer object on success,
821-
or NULL on failure. This is the equivalent of the Python
822-
expression: long(o).
823-
*/
824-
825819
PyAPI_FUNC(PyObject *) PyNumber_Float(PyObject *o);
826820

827821
/*

Objects/typeobject.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5444,7 +5444,7 @@ static slotdef slotdefs[] = {
54445444
UNSLOT("__int__", nb_int, slot_nb_int, wrap_unaryfunc,
54455445
"int(x)"),
54465446
UNSLOT("__long__", nb_long, slot_nb_long, wrap_unaryfunc,
5447-
"long(x)"),
5447+
"int(x)"),
54485448
UNSLOT("__float__", nb_float, slot_nb_float, wrap_unaryfunc,
54495449
"float(x)"),
54505450
NBSLOT("__index__", nb_index, slot_nb_index, wrap_unaryfunc,

0 commit comments

Comments
 (0)