Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
2cba0f64
Commit
2cba0f64
authored
Jan 02, 2001
by
Fred Drake
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve description of else clause of the try/except/else statement.
This closes (again!) bug #127098.
parent
b19f1e37
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
Doc/ref/ref7.tex
Doc/ref/ref7.tex
+11
-6
No files found.
Doc/ref/ref7.tex
View file @
2cba0f64
...
...
@@ -181,7 +181,7 @@ try_exc_stmt: "try" ":" suite
("except" [expression ["," target]] ":" suite)+
["else" ":" suite]
try
_
fin
_
stmt: "try" ":" suite
"finally" ":" suite
"finally" ":" suite
\end{verbatim}
There are two forms of
\keyword
{
try
}
statement:
...
...
@@ -242,12 +242,17 @@ 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 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.
The optional
\keyword
{
else
}
clause is executed if and when control
flows off the end of the
\keyword
{
try
}
clause.
\footnote
{
Currently, control ``flows off the end'' except in the case of an
exception or the execution of 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
}
\stindex
{
return
}
\stindex
{
break
}
\stindex
{
continue
}
The
\keyword
{
try
}
...
\keyword
{
finally
}
form specifies a `cleanup' handler. The
\keyword
{
try
}
clause is executed. When no exception occurs, the
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment