[docs] [issue5416] str.replace does strange things when given a negative count

Senthil Kumaran report at bugs.python.org
Thu Aug 12 05:36:16 CEST 2010

Senthil Kumaran <orsenthil at gmail.com> added the comment:

I am fine with your proposal, Raymond. When I went about the change the docstrings, I did notice that it is not an intentional feature to provide negative values in the replace argument. The negative value (-1 as count) was being used somewhat as a sentinel value to denote replace-all.

I have no problem in reverting current documentation fix, but as a fix we can remove the existing reference of -1 in docstrings of str.replace so that it does not cause any confusing, which was the point of the original bug-report.


Python tracker <report at bugs.python.org>

More information about the docs mailing list