]> git.ipfire.org Git - thirdparty/Python/cpython.git/commit
[3.12] gh-115011: Improve support of __index__() in setters of members with unsigned...
authorSerhiy Storchaka <storchaka@gmail.com>
Sun, 11 Feb 2024 11:56:17 +0000 (13:56 +0200)
committerGitHub <noreply@github.com>
Sun, 11 Feb 2024 11:56:17 +0000 (11:56 +0000)
commitd8346d6c0677b0e8fcff5aa6b179d3c3afca48c6
tree054cc289b1f0ec94e2701855f61a18152c514e4d
parentd65cd8bc4e3a4d070385e2236332c14b63daeada
[3.12] gh-115011: Improve support of __index__() in setters of members with unsigned integer type (GH-115029) (GH-115294)

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