comparison Lib/string.py @ 21849:faaaeb535d39 2.1

string.split() docstring described the interpretation of the maxsplit argument incorrectly. This closes SF bug #505997.
author Fred Drake <fdrake@acm.org>
date Wed, 30 Jan 2002 16:16:38 +0000
parents 79d533934ac1
children
comparison
equal deleted inserted replaced
21805:345b92ed2a3f 21849:faaaeb535d39
102 # Split a string into a list of space/tab-separated words 102 # Split a string into a list of space/tab-separated words
103 def split(s, sep=None, maxsplit=-1): 103 def split(s, sep=None, maxsplit=-1):
104 """split(s [,sep [,maxsplit]]) -> list of strings 104 """split(s [,sep [,maxsplit]]) -> list of strings
105 105
106 Return a list of the words in the string s, using sep as the 106 Return a list of the words in the string s, using sep as the
107 delimiter string. If maxsplit is given, splits into at most 107 delimiter string. If maxsplit is given, splits at no more than
108 maxsplit words. If sep is not specified, any whitespace string 108 maxsplit places (resulting in at most maxsplit+1 words). If sep
109 is a separator. 109 is not specified, any whitespace string is a separator.
110 110
111 (split and splitfields are synonymous) 111 (split and splitfields are synonymous)
112 112
113 """ 113 """
114 return s.split(sep, maxsplit) 114 return s.split(sep, maxsplit)