diff options
Diffstat (limited to 'Lib/string.py')
-rw-r--r-- | Lib/string.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/Lib/string.py b/Lib/string.py index 6faa1f02c8..9c0ebe1fd4 100644 --- a/Lib/string.py +++ b/Lib/string.py @@ -508,15 +508,15 @@ def capitalize(s): return s.capitalize() # Substring replacement (global) -def replace(s, old, new, maxsplit=-1): - """replace (str, old, new[, maxsplit]) -> string +def replace(s, old, new, maxreplace=-1): + """replace (str, old, new[, maxreplace]) -> string Return a copy of string str with all occurrences of substring - old replaced by new. If the optional argument maxsplit is - given, only the first maxsplit occurrences are replaced. + old replaced by new. If the optional argument maxreplace is + given, only the first maxreplace occurrences are replaced. """ - return s.replace(old, new, maxsplit) + return s.replace(old, new, maxreplace) # Try importing optional built-in module "strop" -- if it exists, @@ -607,7 +607,7 @@ class Formatter(object): return str(value) elif conversion is None: return value - raise ValueError("Unknown converion specifier {0!s}".format(conversion)) + raise ValueError("Unknown conversion specifier {0!s}".format(conversion)) # returns an iterable that contains tuples of the form: |