summaryrefslogtreecommitdiffstats
path: root/Objects
diff options
context:
space:
mode:
authorRaymond Hettinger <rhettinger@users.noreply.github.com>2022-02-13 21:42:59 (GMT)
committerGitHub <noreply@github.com>2022-02-13 21:42:59 (GMT)
commit0ae40191793da1877a12d512f0116d99301b2c51 (patch)
tree1856bb402cee8954a16cdb4a3e8175a95e58e2ed /Objects
parent6331c08d1c3248ff47a7b8e0045c9023c9af672c (diff)
downloadcpython-0ae40191793da1877a12d512f0116d99301b2c51.zip
cpython-0ae40191793da1877a12d512f0116d99301b2c51.tar.gz
cpython-0ae40191793da1877a12d512f0116d99301b2c51.tar.bz2
Improve docstring for set.discard() (GH-31315)
Diffstat (limited to 'Objects')
-rw-r--r--Objects/setobject.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/Objects/setobject.c b/Objects/setobject.c
index 0dd2840..c65b7d5 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))