From: Fredrik Lundh Date: Mon, 22 May 2006 15:35:12 +0000 (+0000) Subject: docstring tweaks: count counts non-overlapping substrings, not X-Git-Tag: v2.5b1~597 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=763b50f9d96b0176003fdad41b37cf7fb11c1dda;p=python docstring tweaks: count counts non-overlapping substrings, not total number of occurences --- diff --git a/Objects/stringobject.c b/Objects/stringobject.c index 536caeff97..f3104ee66c 100644 --- a/Objects/stringobject.c +++ b/Objects/stringobject.c @@ -2159,9 +2159,9 @@ string_capitalize(PyStringObject *self) PyDoc_STRVAR(count__doc__, "S.count(sub[, start[, end]]) -> int\n\ \n\ -Return the number of occurrences of substring sub in string\n\ -S[start:end]. Optional arguments start and end are\n\ -interpreted as in slice notation."); +Return the number of non-overlapping occurrences of substring sub in\n\ +string S[start:end]. Optional arguments start and end are interpreted\n\ +as in slice notation."); static PyObject * string_count(PyStringObject *self, PyObject *args) diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c index a3af7f6a85..7d11f7de34 100644 --- a/Objects/unicodeobject.c +++ b/Objects/unicodeobject.c @@ -5078,8 +5078,8 @@ onError: PyDoc_STRVAR(count__doc__, "S.count(sub[, start[, end]]) -> int\n\ \n\ -Return the number of occurrences of substring sub in Unicode string\n\ -S[start:end]. Optional arguments start and end are\n\ +Return the number of non-overlapping occurrences of substring sub in\n\ +Unicode string S[start:end]. Optional arguments start and end are\n\ interpreted as in slice notation."); static PyObject *