Ronan Lamy <[email protected]> added the comment:
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.
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue31984>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com