mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
gh-106487: Allow the 'count' argument of str.replace
to be a keyword (#106488)
This commit is contained in:
parent
dac1e36490
commit
34c14147a2
6 changed files with 54 additions and 14 deletions
|
@ -12025,10 +12025,10 @@ str.replace as unicode_replace
|
|||
|
||||
old: unicode
|
||||
new: unicode
|
||||
/
|
||||
count: Py_ssize_t = -1
|
||||
Maximum number of occurrences to replace.
|
||||
-1 (the default value) means replace all occurrences.
|
||||
/
|
||||
|
||||
Return a copy with all occurrences of substring old replaced by new.
|
||||
|
||||
|
@ -12039,7 +12039,7 @@ replaced.
|
|||
static PyObject *
|
||||
unicode_replace_impl(PyObject *self, PyObject *old, PyObject *new,
|
||||
Py_ssize_t count)
|
||||
/*[clinic end generated code: output=b63f1a8b5eebf448 input=147d12206276ebeb]*/
|
||||
/*[clinic end generated code: output=b63f1a8b5eebf448 input=3345c455d60a5499]*/
|
||||
{
|
||||
return replace(self, old, new, count);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue