Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Doc/library/stdtypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -602,7 +602,7 @@ class`. In addition, it provides a few more methods:

.. method:: int.as_integer_ratio()

Given an int ``x``, return the tuple ``(x, 1)``.
Given an integer ``x``, return the tuple ``(int(x), 1)``.

.. versionadded:: 3.8

Expand Down
4 changes: 2 additions & 2 deletions Objects/clinic/longobject.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions Objects/longobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -6020,7 +6020,7 @@ int_bit_count_impl(PyObject *self)
/*[clinic input]
int.as_integer_ratio

Given an int x, return the tuple (x, 1).
Given an integer x, return the tuple (int(x), 1).

>>> (10).as_integer_ratio()
(10, 1)
Expand All @@ -6032,7 +6032,7 @@ Given an int x, return the tuple (x, 1).

static PyObject *
int_as_integer_ratio_impl(PyObject *self)
/*[clinic end generated code: output=e60803ae1cc8621a input=773adde26ef0a5c3]*/
/*[clinic end generated code: output=e60803ae1cc8621a input=61de2d707e10af00]*/
{
PyObject *ratio_tuple;
PyObject *numerator = long_long(self);
Expand Down