[Python-checkins] r84626 - python/branches/release27-maint/Lib/string.py

senthil.kumaran python-checkins at python.org
Wed Sep 8 14:40:45 CEST 2010


Author: senthil.kumaran
Date: Wed Sep 8 14:40:45 2010
New Revision: 84626
Log:
Issue5416 - Revert a documentatin change made to explain replace on negative value.
Minor changes to doc: s/maxsplit/maxreplace
Modified:
 python/branches/release27-maint/Lib/string.py
Modified: python/branches/release27-maint/Lib/string.py
==============================================================================
--- python/branches/release27-maint/Lib/string.py	(original)
+++ python/branches/release27-maint/Lib/string.py	Wed Sep 8 14:40:45 2010
@@ -508,16 +508,15 @@
 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. A
- negative value of maxsplit signifies all occurances.
+ 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,


More information about the Python-checkins mailing list

AltStyle によって変換されたページ (->オリジナル) /