optimization question

Bernard Delmée bdelmee at advalvas._ZAPME_.be
Sun Aug 11 23:33:36 CEST 2002


>
> Oops, that should be s.find(t,i,j)
>

Right, but we'd still potentially scan megabytes.

How about: (s.find(t,i,min(j,i+len(t)) == i)

Erh... which, provided I got it right this time, isn't
nearly as obviously readable as the original test...





More information about the Python-list mailing list