Switch statement

Joseph L. Casale jcasale at activenetwerx.com
Sun Mar 10 18:18:37 EDT 2013


> Or could you do something like:
>
> arguments_to_pass = [list of some sort]
> switch.get(var, default)(*arguments_to_pass)

Stevens lambda suggestion was most appropriate. Within the switch, there
are functions called with none, or some variation of arguments. It was not
easy to pass them in after the fact, especially since the same function may
have different args depending on which case.

The lamda worked well.

Thanks guys!
jlc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20130310/6def7da8/attachment.html>


More information about the Python-list mailing list