]> granicus.if.org Git - python/commit
In string.split(), honor maxsplit (if > 0).
authorGuido van Rossum <guido@python.org>
Mon, 1 Dec 1997 15:25:19 +0000 (15:25 +0000)
committerGuido van Rossum <guido@python.org>
Mon, 1 Dec 1997 15:25:19 +0000 (15:25 +0000)
commit06ba34c5d47751f9a5ae8e16bf1a7cf12c871609
tree6d67a46a3a02a63f41d4080eb84612cc5294ac4e
parent58a88b3e34f7b992a33ee93001bf6d795acd7f32
In string.split(), honor maxsplit (if > 0).

In string.splitfields(), ignore maxsplit if <= 0, rather than ignoring
maxsplit=0 but effectively treating negative numbers the same as
maxsplit=1.  Also made the test for maxsplit slightly more efficient
(set it to the length of the string when <= 0 so the test for its
presence can be omitted from the loop).
Lib/string.py
Lib/stringold.py