From bb268127a67dc65dbbf668b327c5e6b0fd87ad23 Mon Sep 17 00:00:00 2001 From: CharlieZhao Date: Fri, 29 Dec 2023 16:48:27 +0800 Subject: [PATCH 1/3] improve docs for `issubset` and `issuperset` --- Objects/setobject.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/Objects/setobject.c b/Objects/setobject.c index 88d20019bfb4a7..3bff2749e5ab7c 100644 --- a/Objects/setobject.c +++ b/Objects/setobject.c @@ -1770,7 +1770,11 @@ set_issubset(PySetObject *so, PyObject *other) Py_RETURN_TRUE; } -PyDoc_STRVAR(issubset_doc, "Report whether another set contains this set."); +PyDoc_STRVAR(issubset_doc, +"issubset($self, /, other)\n\ +--\n\ +\n\ +Return True if all elements in this set are found in other(iterable)."); static PyObject * set_issuperset(PySetObject *so, PyObject *other) @@ -1802,7 +1806,11 @@ set_issuperset(PySetObject *so, PyObject *other) Py_RETURN_TRUE; } -PyDoc_STRVAR(issuperset_doc, "Report whether this set contains another set."); +PyDoc_STRVAR(issuperset_doc, +"issuperset($self, /, other)\n\ +--\n\ +\n\ +Return True if all elements in other(iterable) are found in this set."); static PyObject * set_richcompare(PySetObject *v, PyObject *w, int op) From 08e8c6686675332cd9b98027183e55655be5e3ee Mon Sep 17 00:00:00 2001 From: CharlieZhao Date: Sat, 27 Jan 2024 10:54:13 +0800 Subject: [PATCH 2/3] Update docstring based on stdtypes.rst --- Objects/setobject.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Objects/setobject.c b/Objects/setobject.c index 3bff2749e5ab7c..bf721f50f0d810 100644 --- a/Objects/setobject.c +++ b/Objects/setobject.c @@ -1774,7 +1774,7 @@ PyDoc_STRVAR(issubset_doc, "issubset($self, /, other)\n\ --\n\ \n\ -Return True if all elements in this set are found in other(iterable)."); +Test whether every element in the set is in other."); static PyObject * set_issuperset(PySetObject *so, PyObject *other) @@ -1810,7 +1810,7 @@ PyDoc_STRVAR(issuperset_doc, "issuperset($self, /, other)\n\ --\n\ \n\ -Return True if all elements in other(iterable) are found in this set."); +Test whether every element in other is in the set."); static PyObject * set_richcompare(PySetObject *v, PyObject *w, int op) From 1e976ca24bb3507c4a007d4fce3101a61cf1de8b Mon Sep 17 00:00:00 2001 From: CharlieZhao Date: Sat, 27 Jan 2024 17:11:28 +0800 Subject: [PATCH 3/3] Fix docstring --- Objects/setobject.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Objects/setobject.c b/Objects/setobject.c index bf721f50f0d810..93de8e84f2ddf9 100644 --- a/Objects/setobject.c +++ b/Objects/setobject.c @@ -1771,7 +1771,7 @@ set_issubset(PySetObject *so, PyObject *other) } PyDoc_STRVAR(issubset_doc, -"issubset($self, /, other)\n\ +"issubset($self, other, /)\n\ --\n\ \n\ Test whether every element in the set is in other."); @@ -1807,7 +1807,7 @@ set_issuperset(PySetObject *so, PyObject *other) } PyDoc_STRVAR(issuperset_doc, -"issuperset($self, /, other)\n\ +"issuperset($self, other, /)\n\ --\n\ \n\ Test whether every element in other is in the set.");