which one is more efficient

ki lo kilo8257 at gmail.com
Fri Feb 8 19:45:06 EST 2008


I have type variable which may have been set to 'D' or 'E'

Now, which one of following statements are more efficient

if type =='D' or type == 'E':

or

if re.search("D|E", type):

Please let me know because the function is going to called 10s of millions
of times.

Thanks
Kilo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20080208/7ef609be/attachment.html>


More information about the Python-list mailing list