mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
gh-115999: Add free-threaded specialization for `TO_BOOL
` (gh-126616)
This commit is contained in:
parent
09c240f20c
commit
78a530a578
7 changed files with 168 additions and 69 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue