Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Speed up ``set >= set``, ``set > set`` and ``set.issuperset()`` on the free-threaded build.
5 changes: 4 additions & 1 deletion Objects/setobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -2418,6 +2418,9 @@ set_issubset_impl(PySetObject *so, PyObject *other)
Py_ssize_t pos = 0;
int rv;

_Py_CRITICAL_SECTION_ASSERT_OBJECT_LOCKED(so);
_Py_CRITICAL_SECTION_ASSERT_OBJECT_LOCKED(other);
Comment thread
picnixz marked this conversation as resolved.

if (!PyAnySet_Check(other)) {
PyObject *tmp = set_intersection(so, other);
if (tmp == NULL) {
Expand Down Expand Up @@ -2460,7 +2463,7 @@ set_issuperset_impl(PySetObject *so, PyObject *other)
/*[clinic end generated code: output=ecf00ce552c09461 input=5f2e1f262e6e4ccc]*/
{
if (PyAnySet_Check(other)) {
return set_issubset(other, (PyObject *)so);
return set_issubset_impl((PySetObject *)other, (PyObject *)so);
}

PyObject *key, *it = PyObject_GetIter(other);
Expand Down
Loading