Guido van Rossum wrote:
I prefer to focus on "clearer" and "less error-prone" rather than "faster" in most cases.
well, given that "startwith" is by far the most common typo I make when writing Python programs these days, I'm not so sure about that error-proneness thing, but never mind...
I do agree it's a minor embarrassment that s.startswith(t) is slower than s[:len(t)]==t; but I think we should make startswith() faster rather than recommending the other idiom.
absolutely (see the py3k list for some related discussion).