elif alternative

r rt8396 at gmail.com
Thu Sep 17 22:05:57 CEST 2009


On Sep 17, 2:38 pm, gert <gert.cuyk... at gmail.com> wrote:
> Can anybody show me a better looking alternative for this elif
> structure ?
>
> http://code.google.com/p/appwsgi/source/browse/appwsgi/wsgi/appointme...

For starters assign v['cmd'] to a variable instead of looking it up
every time!

cmd = v['cmd']

if cmd == ...
elif cmd == ...
...



More information about the Python-list mailing list