On Fri, May 29, 2015 at 2:59 AM, Marko Rauhamaa <ma...@pacujo.net> wrote:
> When I have coded state machines for C or Java, I have noticed that
> nothing beats enums and switch statements performance-wise, and
> expressively, they're not that bad, either. Python doesn't have a switch
> statement, so the natural thing is to ride on method dispatching
> (whether via inner or outer classes). However, I must say the exception
> "idiom" someone mentioned on this forum way back has its lure:
>
>     try: raise self.state
>     except IDLE:
>         #...
>     except SPF_HELO:
>         #...

I take exception to that idiom. :)

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to