Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
d22bb658
Commit
d22bb658
authored
Oct 22, 2003
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Avoid confusing name for the 3rd argument to str.replace().
This closes SF bug #827260.
parent
f12f3242
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
Doc/lib/libstdtypes.tex
Doc/lib/libstdtypes.tex
+3
-3
Objects/stringobject.c
Objects/stringobject.c
+3
-3
No files found.
Doc/lib/libstdtypes.tex
View file @
d22bb658
...
...
@@ -563,7 +563,7 @@ Decodes the string using the codec registered for \var{encoding}.
may be given to set a different error handling scheme. The default is
\code
{
'strict'
}
, meaning that encoding errors raise
\exception
{
ValueError
}
. Other possible values are
\code
{
'ignore'
}
and
\code
{
replace'
}
.
\code
{
'
replace'
}
.
\versionadded
{
2.2
}
\end{methoddesc}
...
...
@@ -664,10 +664,10 @@ the string this method is called on.
\versionchanged
[Support for the \var{chars} argument]
{
2.2.2
}
\end{methoddesc}
\begin{methoddesc}
[string]
{
replace
}{
old, new
\optional
{
,
maxspli
t
}}
\begin{methoddesc}
[string]
{
replace
}{
old, new
\optional
{
,
coun
t
}}
Return a copy of the string with all occurrences of substring
\var
{
old
}
replaced by
\var
{
new
}
. If the optional argument
\var
{
maxsplit
}
is given, only the first
\var
{
maxspli
t
}
occurrences are
\var
{
count
}
is given, only the first
\var
{
coun
t
}
occurrences are
replaced.
\end{methoddesc}
...
...
Objects/stringobject.c
View file @
d22bb658
...
...
@@ -2308,11 +2308,11 @@ mymemreplace(const char *str, int len, /* input string */
PyDoc_STRVAR
(
replace__doc__
,
"S.replace (old, new[,
maxspli
t]) -> string
\n
\
"S.replace (old, new[,
coun
t]) -> string
\n
\
\n
\
Return a copy of string S with all occurrences of substring
\n
\
old replaced by new. If the optional argument
maxspli
t is
\n
\
given, only the first
maxspli
t occurrences are replaced."
);
old replaced by new. If the optional argument
coun
t is
\n
\
given, only the first
coun
t occurrences are replaced."
);
static
PyObject
*
string_replace
(
PyStringObject
*
self
,
PyObject
*
args
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment