Bugs item #1414673, was opened at 2006-01-25 10:23 Message generated for change (Comment added) made by rhettinger You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1414673&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: Closed >Resolution: Wont Fix Priority: 5 Private: No Submitted By: Collin Winter (collinwinter) Assigned to: Raymond Hettinger (rhettinger) Summary: Underspecified behaviour of string methods split, rsplit Initial Comment: The documentation for the string methods split and rsplit do not address the case where sep=None and maxsplit=0. Should this strip off the leading and trailing whitespace, but not do any splits? Should it simply return the invocant string? ---------------------------------------------------------------------- >Comment By: Raymond Hettinger (rhettinger) Date: 2007-01-05 21:23 Message: Logged In: YES user_id=80475 Originator: NO The docs for split() and rsplit() have reached their limits of complexity. Let the corner cases be defined by what the implementation currently does. IMO, any more attempts to expand these docs can only result in a decrease in clarity and usability. What is there now does a good job at showing you what you need to know to use the methods effectively. ---------------------------------------------------------------------- Comment By: Matt Fleming (splitscreen) Date: 2006-02-18 07:12 Message: Logged In: YES user_id=1126061 >From the documentation of split() "If maxsplit is given, splits at no more than maxsplit places (resulting in at most maxsplit+1 words)." I know that at the moment rsplit() and split() remove any leading whitespace but leave trailing space intact, but I would have thought leaving the string entirely intact would make more sense. Surely, to comply with the statement 'resulting in at most maxsplit+1 words)' the entire string should be returned when maxsplit=0. I can see the point that the leading whitespace isn't actually returned but i don't see why it should be discarded. Just a thought. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1414673&group_id=5470 _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com