Roy Smith <r...@panix.com>: > In article <87fvn08vux....@elektro.pacujo.net>, > Marko Rauhamaa <ma...@pacujo.net> wrote: >> 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.
I actually have employed the idea before in a related but slightly different use case. Anyway, it's extremely close to the switch statement's use case and should give some guidance if a proper switch statement is ever worked into the language. What's killing the performance is the backtrace generation and longjmp trickery. If an analogous syntax could be (A) separated from BaseException and (B) compiled into a dict, we could have a winner. Marko -- https://mail.python.org/mailman/listinfo/python-list