From: Raymond Hettinger Date: Sun, 13 Feb 2022 21:42:59 +0000 (-0600) Subject: Improve docstring for set.discard() (GH-31315) X-Git-Tag: v3.11.0a6~221 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0ae40191793da1877a12d512f0116d99301b2c51;p=thirdparty%2FPython%2Fcpython.git Improve docstring for set.discard() (GH-31315) --- diff --git a/Objects/setobject.c b/Objects/setobject.c index 0dd28402afbd..c65b7d5d2111 100644 --- a/Objects/setobject.c +++ b/Objects/setobject.c @@ -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))