Python style questions

Tim Roberts timr at probo.com
Mon Mar 19 23:58:29 EST 2001


Joshua Marshall <jmarshal at mathworks.com> wrote:
>
>A switch statement may just be syntactic sugar, but not necessarily in
>a simple way.  A good compiler will compile switch statements into
>jump-tables or, at worst, binary searches.  Cluttery to code by hand.
>
>Sure this is "just" an efficiency thing, but switches can get quite big.

But Python, at least today, is not compiled.  Switch statements in an
interpreted language are not as big of a "win".
--
- Tim Roberts, timr at probo.com
  Providenza & Boekelheide, Inc.



More information about the Python-list mailing list