Skip to content

Commit fa94d34

Browse files
committed
Reduce comments in test functions
1 parent 9d02192 commit fa94d34

File tree

1 file changed

+1
-17
lines changed
  • Modules/_testlimitedcapi

1 file changed

+1
-17
lines changed

Modules/_testlimitedcapi/set.c

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -158,22 +158,7 @@ test_frozenset_add_in_capi(PyObject *self, PyObject *Py_UNUSED(obj))
158158
static PyObject *
159159
test_set_contains_does_not_convert_unhashable_key(PyObject *self, PyObject *Py_UNUSED(obj))
160160
{
161-
// The documentation of PySet_Contains state:
162-
//
163-
// int PySet_Contains(PyObject *anyset, PyObject *key)
164-
//
165-
// Part of the Stable ABI.
166-
//
167-
// ... Unlike the Python __contains__() method, this function does not
168-
// automatically convert unhashable sets [key] into temporary frozensets.
169-
// Raise a TypeError if the key is unhashable.
170-
//
171-
// That is to say {2,3} in {1, 2, frozenset({2,3})}
172-
// ^_ will be converted in a frozenset in Python code.
173-
// But not if using PySet_Contains(..., key)
174-
//
175-
// We test that this behavior is unchanged as this is a stable API.
176-
161+
// see documentation of int PySet_Contains in c-api/set.rst
177162
PyObject *outer_set = PySet_New(NULL);
178163

179164
PyObject *needle = PySet_New(NULL);
@@ -189,7 +174,6 @@ test_set_contains_does_not_convert_unhashable_key(PyObject *self, PyObject *Py_U
189174
return NULL;
190175
}
191176

192-
// Add an element to needle to make it {42}
193177
if (PySet_Add(needle, num) < 0) {
194178
Py_DECREF(outer_set);
195179
Py_DECREF(needle);

0 commit comments

Comments
 (0)