> tbl = [(my_regex, doSomething), (my_regex2, doSomething2), (my_regex3, 
> doSomething3)]
> for regex, fun in tbl:
>     match = regexp.match(line)
>     if match:
>        fun(line)
>        break

Thank you for the idea. This is a bit more difficult when functions need 
to work with a common context, but in that case I could store the 
context in an object and use the object's methods.

Thanks,
Ernesto
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to