Message305891
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. |
|
Date |
User |
Action |
Args |
2017-11-08 19:17:49 | Ronan.Lamy | set | recipients:
+ Ronan.Lamy, barry, r.david.murray, serhiy.storchaka |
2017-11-08 19:17:49 | Ronan.Lamy | set | messageid: <1510168669.24.0.213398074469.issue31984@psf.upfronthosting.co.za> |
2017-11-08 19:17:49 | Ronan.Lamy | link | issue31984 messages |
2017-11-08 19:17:49 | Ronan.Lamy | create | |
|