diff options
author | Donghee Na <donghee.na@python.org> | 2024-11-21 22:52:16 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-21 22:52:16 (GMT) |
commit | 78a530a57800264433d1874a41c91b0939156c03 (patch) | |
tree | 93599658400b15d14c46d73f4ff4c58d078cd413 /Include | |
parent | 09c240f20c47db126ad7e162df41e5c2596962d4 (diff) | |
download | cpython-78a530a57800264433d1874a41c91b0939156c03.zip cpython-78a530a57800264433d1874a41c91b0939156c03.tar.gz cpython-78a530a57800264433d1874a41c91b0939156c03.tar.bz2 |
gh-115999: Add free-threaded specialization for ``TO_BOOL`` (gh-126616)
Diffstat (limited to 'Include')
-rw-r--r-- | Include/internal/pycore_typeobject.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Include/internal/pycore_typeobject.h b/Include/internal/pycore_typeobject.h index 5debdd6..7b39d07 100644 --- a/Include/internal/pycore_typeobject.h +++ b/Include/internal/pycore_typeobject.h @@ -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 |