]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.11] gh-115011: Improve support of __index__() in setters of members with unsigned...
authorSerhiy Storchaka <storchaka@gmail.com>
Sun, 11 Feb 2024 12:03:48 +0000 (14:03 +0200)
committerGitHub <noreply@github.com>
Sun, 11 Feb 2024 12:03:48 +0000 (12:03 +0000)
commit7273a58a858817c631bf46ca373f024891e3a22e
tree464cc057aada87c31f9543166291af7cf72c6b54
parente72255054b80006f75f1b945faea35d2a42b243c
[3.11] gh-115011: Improve support of __index__() in setters of members with unsigned integer type (GH-115029) (GH-115295)

Setters for members with an unsigned integer type now support
the same range of valid values for objects that has a __index__()
method as for int.

Previously, Py_T_UINT, Py_T_ULONG and Py_T_ULLONG did not support
objects that has a __index__() method larger than LONG_MAX.

Py_T_ULLONG did not support negative ints. Now it supports them and
emits a RuntimeWarning.
(cherry picked from commit d9d6909697501a2604d5895f9f88aeec61274ab0)
Lib/test/test_capi/test_structmembers.py
Misc/NEWS.d/next/Core and Builtins/2024-02-05-12-40-26.gh-issue-115011.L1AKF5.rst [new file with mode: 0644]
Python/structmember.c