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 ajaksu2
Recipients ajaksu2, dmajnemer
Date 2009-03-04.14:56:05
SpamBayes Score 2.1114865e-10
Marked as misclassified No
Message-id <1236178570.82.0.0125442604814.issue5416@psf.upfronthosting.co.za>
In-reply-to
Content
Confirmed in trunk and py3k. Changing to RFE, set it to behavior if you
disagree.

Python 2.4 does return "" for str.replace("", "", "asdf", -1), the
change happened in rev46226, with the effbot adding this snippet (by
Andrew Dalke?):

      if (maxcount < 0) {
             maxcount = PY_SSIZE_T_MAX;
      } else if (maxcount == 0 || PyString_GET_SIZE(self) == 0) {
           /* nothing to do; return the original string */
           return return_self(self);
      }


I'm not sure the current behavior can be considered better than what
David proposes, but I also wonder whether it matters at all.
History
Date User Action Args
2009-03-04 14:56:11ajaksu2setrecipients: + ajaksu2, dmajnemer
2009-03-04 14:56:10ajaksu2setmessageid: <1236178570.82.0.0125442604814.issue5416@psf.upfronthosting.co.za>
2009-03-04 14:56:06ajaksu2linkissue5416 messages
2009-03-04 14:56:05ajaksu2create