[ python-Bugs-1380970 ] split() description not fully accurate

SourceForge.net noreply at sourceforge.net
Thu Dec 15 00:33:49 CET 2005


Bugs item #1380970, was opened at 2005-12-14 18:33
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1380970&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Documentation
Group: Python 2.4
Status: Open
Resolution: None
Priority: 5
Submitted By: K.C. (kace)
Assigned to: Nobody/Anonymous (nobody)
Summary: split() description not fully accurate

Initial Comment:
The page http://docs.python.org/lib/string-methods.html
reads, in part, "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 both ends."  However,
this is not the behaviour that I'm seeing.  (Although,
I should note that I'd find the described behaviour
more desirable.)  Example,

>>> trow = '1586\tsome-int-name\tNODES: 111_222\n'
>>> print trow
1234    some-int-name   NODES: 111_222

>>> trow.split(None,2)
['1234', 'some-int-name', 'NODES: 111_222\n']
# end example.

Notice that the trailing newline has not been stripped
as the documentation said it should be.  Thanks all.

K.C.



----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1380970&group_id=5470


More information about the Python-bugs-list mailing list