SIGN IN SIGN UP

gh-115754: Add Py_GetConstant() function (#116883)

Add Py_GetConstant() and Py_GetConstantBorrowed() functions.

In the limited C API version 3.13, getting Py_None, Py_False,
Py_True, Py_Ellipsis and Py_NotImplemented singletons is now
implemented as function calls at the stable ABI level to hide
implementation details. Getting these constants still return borrowed
references.

Add _testlimitedcapi/object.c and test_capi/test_object.py to test
Py_GetConstant() and Py_GetConstantBorrowed() functions.
V
Victor Stinner committed
8bea6c411d65cd987616b4ecdb86373e4f21f1c6
Parent: 5a76d1b
Committed by GitHub <noreply@github.com> on 3/21/2024, 4:07:00 PM