Paul Rudin writes:
> Jussi Piitulainen writes:
> 
> > # Option 1.5
> > for spam in sequence:
> >     if not predicate(spam): continue
> >     process(spam)
> >
> > This saves an indent level.
> 
> Just out of interest: is saving an indent level a useful thing?

It might be if process(spam) is a more complex statement.

> I wouldn't lay out my code like that just because if you're coming
> back to it later and reading through quickly it's (to my mind at
> least) easier to miss what's going on.

I agree with the general principle but I have actually done the above
(once or twice) precisely because I found it to be the clearer choice
in a particular situation.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to