Can global variable be passed into Python function?

Roy Smith roy at panix.com
Sun Mar 2 10:34:33 EST 2014


In article <87fvn08vux.fsf at elektro.pacujo.net>,
 Marko Rauhamaa <marko at pacujo.net> wrote:

> Marko Rauhamaa <marko at pacujo.net>:
> 
> > Roy Smith <roy at panix.com>:
> >
> >> Python already has a switch statement.  It's just spelled funny...
> >>
> >> [...]
> >>
> >> try:
> >>    raise value
> >> except Case1:
> >>    print "did case 1"
> >> except (Case2, Case3):
> >>    print "did either case 2 or 3"
> >> else:
> >>    print "did default"
> >
> > Not bad! Definitely worth considering.
> 
> [...]
> 3. TRY-EXCEPT (3500% slower than DICT DISPATCH TABLE)

I'm glad to hear that.  I hope nobody took me seriously when I suggested 
this.



More information about the Python-list mailing list