gh-115999: Add free-threaded specialization for `TO_BOOL` (gh-126616)

This commit is contained in:
Donghee Na 2024-11-22 07:52:16 +09:00 committed by GitHub
parent 09c240f20c
commit 78a530a578
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 168 additions and 69 deletions

View file

@ -269,6 +269,16 @@ extern unsigned int _PyType_GetVersionForCurrentState(PyTypeObject *tp);
PyAPI_FUNC(void) _PyType_SetVersion(PyTypeObject *tp, unsigned int version);
PyTypeObject *_PyType_LookupByVersion(unsigned int version);
// Function pointer type for user-defined validation function that will be
// called by _PyType_Validate().
// It should return 0 if the validation is passed, otherwise it will return -1.
typedef int (*_py_validate_type)(PyTypeObject *);
// It will verify the ``ty`` through user-defined validation function ``validate``,
// and if the validation is passed, it will set the ``tp_version`` as valid
// tp_version_tag from the ``ty``.
extern int _PyType_Validate(PyTypeObject *ty, _py_validate_type validate, unsigned int *tp_version);
#ifdef __cplusplus
}
#endif