commit | 06ba34c5d47751f9a5ae8e16bf1a7cf12c871609 | [log] [tgz] |
---|---|---|
author | Guido van Rossum <guido@python.org> | Mon Dec 01 15:25:19 1997 +0000 |
committer | Guido van Rossum <guido@python.org> | Mon Dec 01 15:25:19 1997 +0000 |
tree | 6d67a46a3a02a63f41d4080eb84612cc5294ac4e | |
parent | 58a88b3e34f7b992a33ee93001bf6d795acd7f32 [diff] |
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).