Test if list contains another list

bearophileHUGS at lycos.com bearophileHUGS at lycos.com
Mon Sep 29 13:12:13 CEST 2008


Derek Martin:
>Quite a lot faster than mine... even without using psyco.<

It's designed for Psyco.


>However they don't appear to buy you much, given that the cases they optimize would probably be rare, and the difference in execution time gained by the optimization is not noticable to the user.<

http://www-igm.univ-mlv.fr/~lecroq/string/node7.html


>Unless you're doing lots and lots of these in your application,<

I don't agree. That's library code, so it has to be efficient and
flexible, because it's designed to be used in many different
situations (if you don't agree, then you can try to suggest a
replacement of the C code of the string search of CPython written by
effbot with some slower code).

Bye,
bearophile



More information about the Python-list mailing list