Martin Panter added the comment:
There may be related discussion in Issue 24243, also about searching for empty
strings. A while ago I meant to add documetation and tests for that, but I lost
momentum after cleaning up the existing tests.
Some of the behaviours are undocumented and surprising, but if you look at the
implementation it is clear they are not accidental. E.g. I think there is a
function called replace_interleave() or something.
IMO you can find an unlimited number of instances of an empty string at index
zero of any string. So calls like "ABC".strip("") are sensible to raise an
exception, and the interleave mode of "ABC".count("") is unexpected. But I
don’t see a big need to change this existing behaviour as long as it is
documented.
----------
nosy: +martin.panter
versions: +Python 2.7
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue28029>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com