[issue1123] split(None, maxsplit) does not strip whitespace correctly

2007-10-08 Thread Georg Brandl
Georg Brandl added the comment: This should now be fixed in r58368. -- nosy: +georg.brandl resolution: -> fixed status: open -> closed __ Tracker <[EMAIL PROTECTED]> __ __

[issue1123] split(None, maxsplit) does not strip whitespace correctly

2007-10-07 Thread Brett Cannon
Brett Cannon added the comment: Re-opening as jafo was referring to the string module's function implementation which is deprecated. The real issue is that the built-in types docs are bad. -- assignee: fdrake -> resolution: invalid -> status: closed -> open versions: +Python 2.6 ___

[issue1123] split(None, maxsplit) does not strip whitespace correctly

2007-09-18 Thread Nir Soffer
Nir Soffer added the comment: 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 '] >>> '

[issue1123] split(None, maxsplit) does not strip whitespace correctly

2007-09-18 Thread Sean Reifschneider
Sean Reifschneider added the comment: In looking at the current documentation: http://docs.python.org/dev/library/string.html#string.split I don't see the wording the original poster mentions. The current documentation of the separator is clear and reasonable. I'm going to call this closed, u

[issue1123] split(None, maxsplit) does not strip whitespace correctly

2007-09-18 Thread Brett Cannon
Brett Cannon added the comment: The algorithm is actually kind of odd:: >>> " a b".split(None, 0) ['a b'] >>> "a b ".split(None, 0) ['a b '] >>> "a b ".split(None, 1) ['a', 'b '] So trailing whitespace on the original string is stripped only if the number of splits is great enough t

[issue1123] split(None, maxsplit) does not strip whitespace correctly

2007-09-17 Thread Sean Reifschneider
Sean Reifschneider added the comment: I believe this is just a place where the documentation could be cleared up. Seems to me the confusion is from the document saying (paraphrased): "white space is removed from both ends". Perhaps it should say something like "runs of 1 or more whitespace are

[issue1123] split(None, maxsplit) does not strip whitespace correctly

2007-09-11 Thread Nir Soffer
Nir Soffer added the comment: There is a problem only when maxsplit is smaller than the available splits. In other cases, the docs and the behavior match. __ Tracker <[EMAIL PROTECTED]> __ ___

[issue1123] split(None, maxsplit) does not strip whitespace correctly

2007-09-10 Thread Fredrik Lundh
Fredrik Lundh added the comment: But wasn't your complaint that the implementation didn't match the documentation? As I said, the *implementation* treats "runs of whitespace" as separators, except for whitespace at the beginning or end (or in other words, it never returns empty strings). That m

[issue1123] split(None, maxsplit) does not strip whitespace correctly

2007-09-10 Thread Nir Soffer
Nir Soffer added the comment: I did not look into the source, but obviously there is striping of leading and trailing whitespace. When you specify a separator you get: >>> ' '.split(' ') ['', '', ''] >>> ' a b '.split(' ') ['', 'a', 'b', ''] So one would expect to get this without strip

[issue1123] split(None, maxsplit) does not strip whitespace correctly

2007-09-10 Thread Fredrik Lundh
Fredrik Lundh added the comment: Looks like a *documentation* bug to me; at the implementation level, None just means "no empty parts, treat runs of whitespace as separators". -- nosy: +effbot __ Tracker <[EMAIL PROTECTED]>

[issue1123] split(None, maxsplit) does not strip whitespace correctly

2007-09-07 Thread Guido van Rossum
Changes by Guido van Rossum: __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/py

[issue1123] split(None, maxsplit) does not strip whitespace correctly

2007-09-07 Thread Guido van Rossum
Changes by Guido van Rossum: __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/py

[issue1123] split(None, maxsplit) does not strip whitespace correctly

2007-09-06 Thread Nir Soffer
Nir Soffer added the comment: set type -- type: -> behavior __ Tracker <[EMAIL PROTECTED]> __ ___ Python-bugs-list mailing list Unsubscribe:

[issue1123] split(None, maxsplit) does not strip whitespace correctly

2007-09-06 Thread Nir Soffer
Nir Soffer added the comment: typo in the title -- title: split(None, maxplit) does not strip whitespace correctly -> split(None, maxsplit) does not strip whitespace correctly __ Tracker <[EMAIL PROTECTED]>