]> granicus.if.org Git - python/commitdiff
Change documentation of 'else' clause of 'try/except' to make clear that it
authorThomas Wouters <thomas@python.org>
Sun, 31 Dec 2000 22:52:59 +0000 (22:52 +0000)
committerThomas Wouters <thomas@python.org>
Sun, 31 Dec 2000 22:52:59 +0000 (22:52 +0000)
doesn't get triggered by 'return', 'break' or 'continue'. If the
'try-inside-continue' patch does not get accepted before next release, the
'or continue' should be removed ;P

Closes SF patch #103045 and SF bug #127098.

Doc/ref/ref7.tex

index 6356cd885b7576a0cf7c5a4045fed7bcd4a156d6..9541718b9745ec19999e3fccfa5d804b9ba925a1 100644 (file)
@@ -242,9 +242,11 @@ that handled an exception.
 \withsubitem{(in module sys)}{\ttindex{exc_type}
   \ttindex{exc_value}\ttindex{exc_traceback}}
 
-The optional \keyword{else} clause is executed when no exception occurs
-in the \keyword{try} clause.  Exceptions in the \keyword{else} clause are
-not handled by the preceding \keyword{except} clauses.
+The optional \keyword{else} clause is executed when the \keyword{try} clause
+terminates by any means other than an exception or executing a
+\keyword{return}, \keyword{continue} or \keyword{break} statement.  
+Exceptions in the \keyword{else} clause are not handled by the preceding
+\keyword{except} clauses.
 \kwindex{else}
 
 The \keyword{try}...\keyword{finally} form specifies a `cleanup' handler.  The