On Wed, Feb 10, 2010 at 3:56 PM, Ethan Furman <et...@stoneleaf.us> wrote: > Tim Chase wrote: >> >> Any thoughts on how others make the choice? >> >> -tkc > > If one branch is only a few lines, it comes first. As often as not, that > tiny branch is checking for errors, and the "else" branch doesn't need to be > indented. > > def func(arg1): > if arg1 is 'stupid': > raise ValueError("that's a stupid argument!") > do_something > do_something_else > etc, etc > > > ~Ethan~ > -- > http://mail.python.org/mailman/listinfo/python-list >
Something similar in a for-loop: for x in y: if not should_process(x): continue # process x -- Gerald Britton -- http://mail.python.org/mailman/listinfo/python-list