Daniel Diniz <aja...@gmail.com> added the comment:

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.

----------
nosy: +ajaksu2
stage:  -> test needed
type:  -> feature request
versions: +Python 2.7, Python 3.1 -Python 2.5

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue5416>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to