Author martin.panter
Recipients SilentGhost, Stéphane Henriot, ericvw, martin.panter, r.david.murray, serhiy.storchaka, vstinner
Date 2016-09-09.00:29:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1473380985.07.0.45484744591.issue28029@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2016-09-09 00:29:45martin.pantersetrecipients: + martin.panter, vstinner, ericvw, r.david.murray, SilentGhost, serhiy.storchaka, Stéphane Henriot
2016-09-09 00:29:45martin.pantersetmessageid: <1473380985.07.0.45484744591.issue28029@psf.upfronthosting.co.za>
2016-09-09 00:29:44martin.panterlinkissue28029 messages
2016-09-09 00:29:43martin.pantercreate