[Python-bugs-list] [ python-Bugs-589965 ] "".split() ignores maxsplit arg

noreply@sourceforge.net noreply@sourceforge.net
Thu, 01 Aug 2002 22:27:28 -0700


Bugs item #589965, was opened at 2002-08-02 15:27
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=589965&group_id=5470

Category: Python Library
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Gregory Bond (gnbond)
Assigned to: Nobody/Anonymous (nobody)
Summary: "".split() ignores maxsplit arg

Initial Comment:
lightning$ python
Python 2.1.1 (#4, Oct 10 2001, 11:07:04) 
[GCC 2.95.3 20010315 (release)] on sunos5
Type "copyright", "credits" or "license" for more
information.
>>> s = 'a b c d e f g'
>>> s.split()
['a', 'b', 'c', 'd', 'e', 'f', 'g']
>>> s.split(maxsplit=3)
['a', 'b', 'c', 'd', 'e', 'f', 'g']
>>> import string
>>> string.split(s, maxsplit=3)
['a', 'b', 'c', 'd e f g']
>>> 
lightning$ 

i.e. s.split(maxsplit=3) is NOT the same as
string.split(s, maxsplit=3)


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

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