Skip to content

Commit 1dc1521

Browse files
gh-117431: Fix str.endswith docstring (#117499)
The first parameter is named 'suffix', not 'prefix'. Regression introduced by commit 444156e
1 parent 8ef9892 commit 1dc1521

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

Objects/clinic/unicodeobject.c.h

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Objects/unicodeobject.c

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13078,16 +13078,24 @@ unicode_startswith_impl(PyObject *self, PyObject *subobj, Py_ssize_t start,
1307813078

1307913079

1308013080
/*[clinic input]
13081-
@text_signature "($self, prefix[, start[, end]], /)"
13082-
str.endswith as unicode_endswith = str.startswith
13081+
@text_signature "($self, suffix[, start[, end]], /)"
13082+
str.endswith as unicode_endswith
13083+
13084+
suffix as subobj: object
13085+
A string or a tuple of strings to try.
13086+
start: slice_index(accept={int, NoneType}, c_default='0') = None
13087+
Optional start position. Default: start of the string.
13088+
end: slice_index(accept={int, NoneType}, c_default='PY_SSIZE_T_MAX') = None
13089+
Optional stop position. Default: end of the string.
13090+
/
1308313091
13084-
Return True if the string ends with the specified prefix, False otherwise.
13092+
Return True if the string ends with the specified suffix, False otherwise.
1308513093
[clinic start generated code]*/
1308613094

1308713095
static PyObject *
1308813096
unicode_endswith_impl(PyObject *self, PyObject *subobj, Py_ssize_t start,
1308913097
Py_ssize_t end)
13090-
/*[clinic end generated code: output=cce6f8ceb0102ca9 input=82cd5ce9e7623646]*/
13098+
/*[clinic end generated code: output=cce6f8ceb0102ca9 input=00fbdc774a7d4d71]*/
1309113099
{
1309213100
if (PyTuple_Check(subobj)) {
1309313101
Py_ssize_t i;

0 commit comments

Comments
 (0)