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
eb8b0d20
Commit
eb8b0d20
authored
Feb 07, 1995
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added classes as exceptions
parent
626c1e78
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
16 deletions
+32
-16
Doc/ref/ref6.tex
Doc/ref/ref6.tex
+11
-4
Doc/ref/ref7.tex
Doc/ref/ref7.tex
+5
-4
Doc/ref6.tex
Doc/ref6.tex
+11
-4
Doc/ref7.tex
Doc/ref7.tex
+5
-4
No files found.
Doc/ref/ref6.tex
View file @
eb8b0d20
...
...
@@ -324,13 +324,20 @@ raise_stmt: "raise" condition ["," condition]
\end{verbatim}
\verb
@
raise
@
evaluates its first condition, which must yield
a string object. If there is a second condition, this is evaluated,
else
\verb
@
None
@
is substituted.
a string, class, or instance object. If there is a second condition,
this is evaluated, else
\verb
@
None
@
is substituted. If the first
condition is a class object, then the second condition must be an
instance of that class or one of its derivatives. If the first
condition is an instance object, the second condition must be
\verb
@
None
@
.
\index
{
exception
}
\indexii
{
raising
}{
exception
}
It then raises the exception identified by the first object,
with the second one (or
\verb
@
None
@
) as its parameter.
If the first object is a class or string, it then raises the exception
identified by the first object, with the second one (or
\verb
@
None
@
)
as its parameter. If the first object is an instance, it raises the
exception identified by the class of the object, with the instance as
its parameter.
\section
{
The
{
\tt
break
}
statement
}
\stindex
{
break
}
...
...
Doc/ref/ref7.tex
View file @
eb8b0d20
...
...
@@ -201,10 +201,11 @@ clause, if present, must be last; it matches any exception. For an
except clause with a condition, that condition is evaluated, and the
clause matches the exception if the resulting object is ``compatible''
with the exception. An object is compatible with an exception if it
is either the object that identifies the exception or it is a tuple
containing an item that is compatible with the exception. Note that
the object identities must match, i.e. it must be the same object, not
just an object with the same value.
is either the object that identifies the exception, or (for exceptions
that are classes) it is a base class of the exception, or it is a
tuple containing an item that is compatible with the exception. Note
that the object identities must match, i.e. it must be the same
object, not just an object with the same value.
\kwindex
{
except
}
If no except clause matches the exception, the search for an exception
...
...
Doc/ref6.tex
View file @
eb8b0d20
...
...
@@ -324,13 +324,20 @@ raise_stmt: "raise" condition ["," condition]
\end{verbatim}
\verb
@
raise
@
evaluates its first condition, which must yield
a string object. If there is a second condition, this is evaluated,
else
\verb
@
None
@
is substituted.
a string, class, or instance object. If there is a second condition,
this is evaluated, else
\verb
@
None
@
is substituted. If the first
condition is a class object, then the second condition must be an
instance of that class or one of its derivatives. If the first
condition is an instance object, the second condition must be
\verb
@
None
@
.
\index
{
exception
}
\indexii
{
raising
}{
exception
}
It then raises the exception identified by the first object,
with the second one (or
\verb
@
None
@
) as its parameter.
If the first object is a class or string, it then raises the exception
identified by the first object, with the second one (or
\verb
@
None
@
)
as its parameter. If the first object is an instance, it raises the
exception identified by the class of the object, with the instance as
its parameter.
\section
{
The
{
\tt
break
}
statement
}
\stindex
{
break
}
...
...
Doc/ref7.tex
View file @
eb8b0d20
...
...
@@ -201,10 +201,11 @@ clause, if present, must be last; it matches any exception. For an
except clause with a condition, that condition is evaluated, and the
clause matches the exception if the resulting object is ``compatible''
with the exception. An object is compatible with an exception if it
is either the object that identifies the exception or it is a tuple
containing an item that is compatible with the exception. Note that
the object identities must match, i.e. it must be the same object, not
just an object with the same value.
is either the object that identifies the exception, or (for exceptions
that are classes) it is a base class of the exception, or it is a
tuple containing an item that is compatible with the exception. Note
that the object identities must match, i.e. it must be the same
object, not just an object with the same value.
\kwindex
{
except
}
If no except clause matches the exception, the search for an exception
...
...
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