mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
gh-132657: Avoid locking in frozenset.__contains__ (#132659)
This commit is contained in:
parent
678b8e1656
commit
e77d6784e7
2 changed files with 46 additions and 2 deletions
24
Objects/clinic/setobject.c.h
generated
24
Objects/clinic/setobject.c.h
generated
|
@ -432,6 +432,28 @@ set___contains__(PyObject *so, PyObject *key)
|
|||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(frozenset___contains____doc__,
|
||||
"__contains__($self, object, /)\n"
|
||||
"--\n"
|
||||
"\n"
|
||||
"x.__contains__(y) <==> y in x.");
|
||||
|
||||
#define FROZENSET___CONTAINS___METHODDEF \
|
||||
{"__contains__", (PyCFunction)frozenset___contains__, METH_O|METH_COEXIST, frozenset___contains____doc__},
|
||||
|
||||
static PyObject *
|
||||
frozenset___contains___impl(PySetObject *so, PyObject *key);
|
||||
|
||||
static PyObject *
|
||||
frozenset___contains__(PyObject *so, PyObject *key)
|
||||
{
|
||||
PyObject *return_value = NULL;
|
||||
|
||||
return_value = frozenset___contains___impl((PySetObject *)so, key);
|
||||
|
||||
return return_value;
|
||||
}
|
||||
|
||||
PyDoc_STRVAR(set_remove__doc__,
|
||||
"remove($self, object, /)\n"
|
||||
"--\n"
|
||||
|
@ -532,4 +554,4 @@ set___sizeof__(PyObject *so, PyObject *Py_UNUSED(ignored))
|
|||
|
||||
return return_value;
|
||||
}
|
||||
/*[clinic end generated code: output=e2f1470de062d661 input=a9049054013a1b77]*/
|
||||
/*[clinic end generated code: output=7f7fe845ca165078 input=a9049054013a1b77]*/
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue