FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

gh-117431: Fix str.endswith docstring by erlend-aasland · Pull Request #117499 · python/cpython · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension .c  (1) .h  (1) All 2 file types selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
8 changes: 4 additions & 4 deletions Objects/clinic/unicodeobject.c.h

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 12 additions & 4 deletions Objects/unicodeobject.c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
Expand Up @@ -13078,16 +13078,24 @@ unicode_startswith_impl(PyObject *self, PyObject *subobj, Py_ssize_t start,


/*[clinic input]
@text_signature "($self, prefix[, start[, end]], /)"
str.endswith as unicode_endswith = str.startswith
@text_signature "($self, suffix[, start[, end]], /)"
str.endswith as unicode_endswith

suffix as subobj: object
A string or a tuple of strings to try.
start: slice_index(accept={int, NoneType}, c_default='0') = None
Optional start position. Default: start of the string.
Comment thread
erlend-aasland marked this conversation as resolved.
end: slice_index(accept={int, NoneType}, c_default='PY_SSIZE_T_MAX') = None
Optional stop position. Default: end of the string.
/

Return True if the string ends with the specified prefix, False otherwise.
Return True if the string ends with the specified suffix, False otherwise.
[clinic start generated code]*/

static PyObject *
unicode_endswith_impl(PyObject *self, PyObject *subobj, Py_ssize_t start,
Py_ssize_t end)
/*[clinic end generated code: output=cce6f8ceb0102ca9 input=82cd5ce9e7623646]*/
/*[clinic end generated code: output=cce6f8ceb0102ca9 input=00fbdc774a7d4d71]*/
{
if (PyTuple_Check(subobj)) {
Py_ssize_t i;
Expand Down

Back | FazBrowse Home | New Git URL