mirror of
https://github.com/python/cpython.git
synced 2025-12-10 11:00:14 +00:00
gh-137368: document __index__() support for PyLong_AsInt32/64() (GH-137369)
This commit is contained in:
parent
a46ed665ff
commit
4dd85b347f
1 changed files with 4 additions and 0 deletions
|
|
@ -372,6 +372,10 @@ distinguished from a number. Use :c:func:`PyErr_Occurred` to disambiguate.
|
|||
Set *\*value* to a signed C :c:expr:`int32_t` or :c:expr:`int64_t`
|
||||
representation of *obj*.
|
||||
|
||||
If *obj* is not an instance of :c:type:`PyLongObject`, first call its
|
||||
:meth:`~object.__index__` method (if present) to convert it to a
|
||||
:c:type:`PyLongObject`.
|
||||
|
||||
If the *obj* value is out of range, raise an :exc:`OverflowError`.
|
||||
|
||||
Set *\*value* and return ``0`` on success.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue