homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author nirs
Recipients brett.cannon, effbot, fdrake, jafo, nirs
Date 2007年09月19日.04:12:50
SpamBayes Score 0.0070986063
Marked as misclassified No
Message-id <1190175171.06.0.892508548582.issue1123@psf.upfronthosting.co.za>
In-reply-to
Content
I quoted str.split docs:
- http://docs.python.org/lib/string-methods.html
- http://docs.python.org/dev/library/stdtypes.html
- http://docs.python.org/dev/3.0/library/stdtypes.html
string.split doc does it explain this:
>>> ' a b '.split(None, 1)
['a', 'b ']
>>> ' a b '.split(None, 2)
['a', 'b']
.split method docs is more clear and describe this in a very simple way. 
This is a better description of the current behavior:
 "If sep is not specified or is None, a different splitting algorithm 
is applied. First, whitespace characters (spaces, tabs, newlines, 
returns, and formfeeds) are stripped from the start of the string. Then, 
words are separated by arbitrary length strings of whitespace 
characters. Consecutive whitespace delimiters are treated as a single 
delimiter ("' 1 \t 2 \n 3 '.split()" returns "['1', '2', '3']").
 If maxsplit is nonzero, at most maxsplit number of splits occur, and 
the remainder of the string is returned as the final element of the 
list, unless it is empty. Splitting an empty string or a string 
consisting of just whitespace returns an empty list."
History
Date User Action Args
2007年09月19日 04:12:51nirssetspambayes_score: 0.00709861 -> 0.0070986063
recipients: + nirs, fdrake, effbot, brett.cannon, jafo
2007年09月19日 04:12:51nirssetspambayes_score: 0.00709861 -> 0.00709861
messageid: <1190175171.06.0.892508548582.issue1123@psf.upfronthosting.co.za>
2007年09月19日 04:12:51nirslinkissue1123 messages
2007年09月19日 04:12:50nirscreate

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