mirror of
https://github.com/python/cpython.git
synced 2025-12-31 04:23:37 +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
|
|
@ -5645,6 +5645,24 @@ _PyType_SetFlags(PyTypeObject *self, unsigned long mask, unsigned long flags)
|
|||
END_TYPE_LOCK();
|
||||
}
|
||||
|
||||
int
|
||||
_PyType_Validate(PyTypeObject *ty, _py_validate_type validate, unsigned int *tp_version)
|
||||
{
|
||||
int err;
|
||||
BEGIN_TYPE_LOCK();
|
||||
err = validate(ty);
|
||||
if (!err) {
|
||||
if(assign_version_tag(_PyInterpreterState_GET(), ty)) {
|
||||
*tp_version = ty->tp_version_tag;
|
||||
}
|
||||
else {
|
||||
err = -1;
|
||||
}
|
||||
}
|
||||
END_TYPE_LOCK();
|
||||
return err;
|
||||
}
|
||||
|
||||
static void
|
||||
set_flags_recursive(PyTypeObject *self, unsigned long mask, unsigned long flags)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue