Skip to content

Commit 0ae4019

Browse files
authored
Improve docstring for set.discard() (GH-31315)
1 parent 6331c08 commit 0ae4019

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Objects/setobject.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1930,7 +1930,8 @@ set_discard(PySetObject *so, PyObject *key)
19301930
PyDoc_STRVAR(discard_doc,
19311931
"Remove an element from a set if it is a member.\n\
19321932
\n\
1933-
If the element is not a member, do nothing.");
1933+
Unlike set.remove(), the discard() method does not raise\n\
1934+
an exception when an element is missing from the set.");
19341935

19351936
static PyObject *
19361937
set_reduce(PySetObject *so, PyObject *Py_UNUSED(ignored))

0 commit comments

Comments
 (0)