[issue31984] startswith and endswith leak implementation details

Serhiy Storchaka report at bugs.python.org
Wed Nov 8 13:05:54 EST 2017


Serhiy Storchaka <storchaka+cpython at gmail.com> added the comment:

See issue24284. `s1.startswith(s2, start, end)` for non-negative indices and non-tuple s2 is equivalent to expressions

    start + len(s2) <= end and s2[start: start + len(s2)] == s2

or
    s1.find(s2, start, end) == start

----------
nosy: +serhiy.storchaka

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue31984>
_______________________________________


More information about the Python-bugs-list mailing list