Michael Spencer: > # perhaps faster > $ python -mtimeit -s"t='D'" "if t in 'DE': pass" > 1000000 loops, best of 3: 0.204 usec per loop
That may be faster indeed, but it gives true if t is "DE" too, and that may be bad. The new string search done by Effbot is really good :-) Bye, bearophile -- http://mail.python.org/mailman/listinfo/python-list