This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author orsenthil
Recipients ajaksu2, dmajnemer, orsenthil
Date 2009-03-04.15:04:56
SpamBayes Score 6.250171e-07
Marked as misclassified No
Message-id <7c42eba10903040704m2a8fa46arc0f967814b9e20a5@mail.gmail.com>
In-reply-to <1236178570.82.0.0125442604814.issue5416@psf.upfronthosting.co.za>
Content
And also look at the help on string.replace which sets -1 as the
default value for maxsplit optional argument and which again defaults
to replace-all.
Clearly, maxsplit= -1 is not equal to maxsplit = 0.

replace(s, old, new, maxsplit=-1)
    replace (str, old, new[, maxsplit]) -> string

    Return a copy of string str with all occurrences of substring
    old replaced by new. If the optional argument maxsplit is
    given, only the first maxsplit occurrences are replaced.

- Daniel, thanks for digging this out from Py2.4, unless we get an
rationale behind this change, my only though on this issue was -
document the maxsplit argument  saying that -1 defaults to replace
all.
History
Date User Action Args
2009-03-04 15:04:58orsenthilsetrecipients: + orsenthil, ajaksu2, dmajnemer
2009-03-04 15:04:57orsenthillinkissue5416 messages
2009-03-04 15:04:56orsenthilcreate