Le Mon, 11 Feb 2013 11:02:04 -0800, Guido van Rossum firstname.lastname@example.org a écrit :
Warning: see http://bugs.python.org/issue17170. Depending on the length of the string being scanned and the probability of finding the specific character, the proposed change could actually be a *pessimization*. OTOH if the character occurs many times, the slice will actually cause O(N**2) behavior. So yes, it depends greatly on the distribution of the input data.
That said, the savings are still puny unless you spend your time calling str.find().