a 'case' statement?

Chad Netzer cnetzer at mail.arc.nasa.gov
Fri Feb 14 20:16:51 EST 2003


On Fri, 2003-02-14 at 16:46, Bengt Richter wrote:

> The trouble with all the function-calling variants is that they
> require function calls, and code inside the functions can't rebind
> anything in the local scope where the case construct is, which
> results in ugly mutable-parameter tricks.

Or redesign of the algorithm implementation to be less dependent on
functional side effects in the local namespace.  In situations where the
'cases' of a switch statement are gonna be fairly complex (rather than
call a function), an if-then-else chain is not such a disadvantage
(IMO).

-- 
Bay Area Python Interest Group - http://www.baypiggies.net/

Chad Netzer
(any opinion expressed is my own and not NASA's or my employer's)







More information about the Python-list mailing list