On 2013-08-23 06:20, Amit Saha wrote:
> On Fri, Aug 23, 2013 at 6:14 AM, leam hall <leamh...@gmail.com> wrote:
> > If I have a series of tasks that depend on X happening, should I put them
> > all in the same "try" block or just put X in there and exit out if it fails?
> 
> You are right about the latter. You should put only the statement
> which you expect to raise the exception.

You can also use the "else" clause if there is stuff you want to run if the try
block doesn't raise the caught exception, which avoids putting it in "try" if
you don't intend to exit from the exception.

Attachment: pgp3aZGkPDAT6.pgp
Description: PGP signature

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to