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 Ronan.Lamy
Recipients Ronan.Lamy, barry, r.david.murray, serhiy.storchaka
Date 2017-11-08.19:17:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1510168669.24.0.213398074469.issue31984@psf.upfronthosting.co.za>
In-reply-to
Content
Ah, thanks, I noticed the discrepancy between unicode and str in 2.7, but wondered when it was fixed. I guess I'm arguing that it was resolved in the wrong direction, then.

Now, your first expression is wrong, even after fixing the obvious typo. The correct version is:
    start + len(s2) <= min(len(s1), end) and s1[start: start + len(s2)] == s2

If the person who implemented the behaviour can get it right, who will? ;-)

The second expression is correct, but I'll argue that it shows that find() also suffers from a discrepancy between its basic one-argument form and the extended ones.
History
Date User Action Args
2017-11-08 19:17:49Ronan.Lamysetrecipients: + Ronan.Lamy, barry, r.david.murray, serhiy.storchaka
2017-11-08 19:17:49Ronan.Lamysetmessageid: <1510168669.24.0.213398074469.issue31984@psf.upfronthosting.co.za>
2017-11-08 19:17:49Ronan.Lamylinkissue31984 messages
2017-11-08 19:17:49Ronan.Lamycreate