[Patches] [ python-Patches-1108303 ] fix .split() maxsplit doc, update .rsplit() docs

SourceForge.net noreply at sourceforge.net
Wed Jan 26 23:52:50 CET 2005


Patches item #1108303, was opened at 2005-01-24 07:25
Message generated for change (Comment added) made by rhettinger
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1108303&group_id=5470

Category: Documentation
Group: None
>Status: Closed
>Resolution: Rejected
Priority: 5
Submitted By: Wummel (calvin)
Assigned to: Raymond Hettinger (rhettinger)
Summary: fix .split() maxsplit doc, update .rsplit() docs

Initial Comment:
Hi,

this documentation patch for the .split() and .rsplit()
methods changes the following:
1) remove a superfluous dot in .split() method doc
2) Only if separator arg is _less than_ zero, the
number of splits is unlimited. If it is zero, the
number of splits is (correctly) zero. The "less than"
has been added.
3) The separator documentation of split() is copied
over to rsplit() documentation where it applies too.

The patch is against CVS from 20040123.


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

>Comment By: Raymond Hettinger (rhettinger)
Date: 2005-01-26 17:52

Message:
Logged In: YES 
user_id=80475

I removed the "or is zero" phrase from the docs.  That was
clearly incorrect.  Amazingly, there were already test cases
for it.

The rest of the patch is being rejected.  The behavior for
negative values of maxsplit is an implementation quirk, not
a core feature that needs to be perpetuated through being
documented and tested.

The string module does take advantage of maxsplit=-1 as
default.   This is also an implementation specific quirk and
equivalent functionality can be had by using *args or by
having a None default followed by an if-statement.

Thanks for pointing out the documentation error in the case
where maxsplitt==0.


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

Comment By: Wummel (calvin)
Date: 2005-01-25 15:59

Message:
Logged In: YES 
user_id=9205

Part 2) of the patch still applies: it should be "less than
zero" instead of just "zero". And the attached
pysplittests.diff add the appropriate test cases with "-1"
as maxsplit.

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

Comment By: Raymond Hettinger (rhettinger)
Date: 2005-01-25 15:46

Message:
Logged In: YES 
user_id=80475

Before seeing this patch, I fixed up the related bug.
Please check the most recent update to libstdtypes.tex and
make sure it meets your needs.  If so, please close out this
patch.

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

Comment By: Alan Green (alanvgreen)
Date: 2005-01-25 07:40

Message:
Logged In: YES 
user_id=1174944

Docs read well and work fine. Tests pass on my linux-based
development PC. 

Please apply this patch.

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

Comment By: Wummel (calvin)
Date: 2005-01-24 07:29

Message:
Logged In: YES 
user_id=9205

Argl, please replace any mention of "separator" above with
"maxsplit". Sorry for the confusion.

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

Comment By: Wummel (calvin)
Date: 2005-01-24 07:26

Message:
Logged In: YES 
user_id=9205

I also added appropriate test cases for split() and rsplit()
with negative separator argument.

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

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


More information about the Patches mailing list