]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Improve docstring for set.discard() (GH-31315)
authorRaymond Hettinger <rhettinger@users.noreply.github.com>
Sun, 13 Feb 2022 21:42:59 +0000 (15:42 -0600)
committerGitHub <noreply@github.com>
Sun, 13 Feb 2022 21:42:59 +0000 (15:42 -0600)
Objects/setobject.c

index 0dd28402afbd29e91d867c1c7389f93a8a307adb..c65b7d5d21115988d53c70d1b0a182844cd2b02b 100644 (file)
@@ -1930,7 +1930,8 @@ set_discard(PySetObject *so, PyObject *key)
 PyDoc_STRVAR(discard_doc,
 "Remove an element from a set if it is a member.\n\
 \n\
-If the element is not a member, do nothing.");
+Unlike set.remove(), the discard() method does not raise\n\
+an exception when an element is missing from the set.");
 
 static PyObject *
 set_reduce(PySetObject *so, PyObject *Py_UNUSED(ignored))