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
9195f55b
Commit
9195f55b
authored
Sep 25, 1998
by
Barry Warsaw
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated the docstring and class hierarchy diagram
parent
4f94c738
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
12 deletions
+20
-12
Lib/exceptions.py
Lib/exceptions.py
+20
-12
No files found.
Lib/exceptions.py
View file @
9195f55b
"""Class based built-in exception hierarchy.
This is a new feature whereby all the standard built-in exceptions,
traditionally string objects, are replaced with classes. This gives
Python's exception handling mechanism a more object-oriented feel.
New with Python 1.5, all standard built-in exceptions are now class objects by
default. This gives Python's exception handling mechanism a more
object-oriented feel. Traditionally they were string objects. Python will
fallback to string based exceptions if the interpreter is invoked with the -X
option, or if some failure occurs during class exception initialization (in
this case a warning will be printed).
Most existing code should continue to work with class based
exceptions. Some tricky uses of IOError may break, but the most
common uses should work.
Most existing code should continue to work with class based exceptions. Some
tricky uses of IOError may break, but the most common uses should work.
To disable this feature, start the Python executable with the -X option.
Here is a rundown of the class hierarchy. You can change this by editing this
file, but it isn't recommended. The class names described here are expected
to be found by the bltinmodule.c file.
Here is a rundown of the class hierarchy. You can change this by
editing this file, but it isn't recommended. The classes with a `*'
are new with this feature. They are defined as tuples containing the
derived exceptions when string-based exceptions are used
.
The classes with a `*' are new as of Python 1.5. They are defined as tuples
containing the derived exceptions when string-based exceptions are used. If
you define your own class based exceptions, they should be derived from
Exception
.
Exception(*)
|
...
...
@@ -22,7 +26,11 @@ Exception(*)
+-- SystemExit
+-- KeyboardInterrupt
+-- ImportError
+-- IOError
+-- EnvironmentError(*)
| |
| +-- IOError
| +-- OSError(*)
|
+-- EOFError
+-- RuntimeError
+-- NameError
...
...
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