which one is more efficient

ki lo kilo8257 at gmail.com
Sat Feb 9 01:45:06 CET 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':


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

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

-------------- 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