From 8e40fdf55b6e36cbbac9fb959db28db52d6809e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Wed, 10 Jul 2019 00:18:35 +0200 Subject: [PATCH] Updated built-in exceptions diagram --- README.md | 40 ++++++++++++++++++++-------------------- index.html | 40 ++++++++++++++++++++-------------------- 2 files changed, 40 insertions(+), 40 deletions(-) diff --git a/README.md b/README.md index f5e4a18..e8d6d7e 100644 --- a/README.md +++ b/README.md @@ -1366,27 +1366,27 @@ except : ``` ### Common Built-in Exceptions -```python +```text BaseException - ├── SystemExit # Raised by the sys.exit() function. - ├── KeyboardInterrupt # Raised when the user hits the interrupt key. - └── Exception # User-defined exceptions should be derived from this class. - ├── StopIteration # Raised by next() when run on an empty iterator. - ├── ArithmeticError # Base class for arithmetic errors. - │ └── ZeroDivisionError # Raised when dividing by zero. - ├── AttributeError # Raised when an attribute is missing. - ├── EOFError # Raised by input() when it hits end-of-file condition. - ├── LookupError # Raised when a look-up on sequence or dict fails. - │ ├── IndexError # Raised when a sequence index is out of range. - │ └── KeyError # Raised when a dictionary key is not found. - ├── NameError # Raised when a variable name is not found. - ├── OSError # Failures such as “file not found” or “disk full”. - │ └── FileNotFoundError # When a file or directory is requested but doesn't exist. - ├── RuntimeError # Raised by errors that don't fall in other categories. - │ └── RecursionError # Raised when the the maximum recursion depth is exceeded. - ├── TypeError # Raised when an argument is of wrong type. - └── ValueError # When an argument is of right type but inappropriate value. - └── UnicodeError # Raised when encoding/decoding strings from/to bytes fails. + +-- SystemExit # Raised by the sys.exit() function. + +-- KeyboardInterrupt # Raised when the user hits the interrupt key. + +-- Exception # User-defined exceptions should be derived from this class. + +-- StopIteration # Raised by next() when run on an empty iterator. + +-- ArithmeticError # Base class for arithmetic errors. + | +-- ZeroDivisionError # Raised when dividing by zero. + +-- AttributeError # Raised when an attribute is missing. + +-- EOFError # Raised by input() when it hits end-of-file condition. + +-- LookupError # Raised when a look-up on sequence or dict fails. + | +-- IndexError # Raised when a sequence index is out of range. + | +-- KeyError # Raised when a dictionary key is not found. + +-- NameError # Raised when a variable name is not found. + +-- OSError # Failures such as “file not found” or “disk full”. + | +-- FileNotFoundError # When a file or directory is requested but doesn't exist. + +-- RuntimeError # Raised by errors that don't fall in other categories. + | +-- RecursionError # Raised when the the maximum recursion depth is exceeded. + +-- TypeError # Raised when an argument is of wrong type. + +-- ValueError # When an argument is of right type but inappropriate value. + +-- UnicodeError # Raised when encoding/decoding strings from/to bytes fails. ``` ### User-defined Exceptions diff --git a/index.html b/index.html index 436a743..b3797bb 100644 --- a/index.html +++ b/index.html @@ -1258,26 +1258,26 @@ LogicOp = Enum('LogicOp', {raise

Common Built-in Exceptions

-
BaseException
- ├── SystemExit                   # Raised by the sys.exit() function.
- ├── KeyboardInterrupt            # Raised when the user hits the interrupt key.
- └── Exception                    # User-defined exceptions should be derived from this class.
-      ├── StopIteration           # Raised by next() when run on an empty iterator.
-      ├── ArithmeticError         # Base class for arithmetic errors.
-      │    └── ZeroDivisionError  # Raised when dividing by zero.
-      ├── AttributeError          # Raised when an attribute is missing.
-      ├── EOFError                # Raised by input() when it hits end-of-file condition.
-      ├── LookupError             # Raised when a look-up on sequence or dict fails.
-      │    ├── IndexError         # Raised when a sequence index is out of range.
-      │    └── KeyError           # Raised when a dictionary key is not found.
-      ├── NameError               # Raised when a variable name is not found.
-      ├── OSError                 # Failures such as “file not found” or “disk full”.
-      │    └── FileNotFoundError  # When a file or directory is requested but doesn't exist.
-      ├── RuntimeError            # Raised by errors that don't fall in other categories.
-      │    └── RecursionError     # Raised when the the maximum recursion depth is exceeded.
-      ├── TypeError               # Raised when an argument is of wrong type.
-      └── ValueError              # When an argument is of right type but inappropriate value.
-           └── UnicodeError       # Raised when encoding/decoding strings from/to bytes fails.
+
BaseException
+ +-- SystemExit                   # Raised by the sys.exit() function.
+ +-- KeyboardInterrupt            # Raised when the user hits the interrupt key.
+ +-- Exception                    # User-defined exceptions should be derived from this class.
+      +-- StopIteration           # Raised by next() when run on an empty iterator.
+      +-- ArithmeticError         # Base class for arithmetic errors.
+      |    +-- ZeroDivisionError  # Raised when dividing by zero.
+      +-- AttributeError          # Raised when an attribute is missing.
+      +-- EOFError                # Raised by input() when it hits end-of-file condition.
+      +-- LookupError             # Raised when a look-up on sequence or dict fails.
+      |    +-- IndexError         # Raised when a sequence index is out of range.
+      |    +-- KeyError           # Raised when a dictionary key is not found.
+      +-- NameError               # Raised when a variable name is not found.
+      +-- OSError                 # Failures such as “file not found” or “disk full”.
+      |    +-- FileNotFoundError  # When a file or directory is requested but doesn't exist.
+      +-- RuntimeError            # Raised by errors that don't fall in other categories.
+      |    +-- RecursionError     # Raised when the the maximum recursion depth is exceeded.
+      +-- TypeError               # Raised when an argument is of wrong type.
+      +-- ValueError              # When an argument is of right type but inappropriate value.
+           +-- UnicodeError       # Raised when encoding/decoding strings from/to bytes fails. 
 

User-defined Exceptions

class MyError(Exception):