Skip to content

Commit 8e40fdf

Browse files
committed
Updated built-in exceptions diagram
1 parent a927bfa commit 8e40fdf

File tree

2 files changed

+40
-40
lines changed

2 files changed

+40
-40
lines changed

README.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1366,27 +1366,27 @@ except <exception>:
13661366
```
13671367

13681368
### Common Built-in Exceptions
1369-
```python
1369+
```text
13701370
BaseException
1371-
├── SystemExit # Raised by the sys.exit() function.
1372-
├── KeyboardInterrupt # Raised when the user hits the interrupt key.
1373-
└── Exception # User-defined exceptions should be derived from this class.
1374-
├── StopIteration # Raised by next() when run on an empty iterator.
1375-
├── ArithmeticError # Base class for arithmetic errors.
1376-
└── ZeroDivisionError # Raised when dividing by zero.
1377-
├── AttributeError # Raised when an attribute is missing.
1378-
├── EOFError # Raised by input() when it hits end-of-file condition.
1379-
├── LookupError # Raised when a look-up on sequence or dict fails.
1380-
├── IndexError # Raised when a sequence index is out of range.
1381-
└── KeyError # Raised when a dictionary key is not found.
1382-
├── NameError # Raised when a variable name is not found.
1383-
├── OSError # Failures such as “file not found” or “disk full”.
1384-
└── FileNotFoundError # When a file or directory is requested but doesn't exist.
1385-
├── RuntimeError # Raised by errors that don't fall in other categories.
1386-
└── RecursionError # Raised when the the maximum recursion depth is exceeded.
1387-
├── TypeError # Raised when an argument is of wrong type.
1388-
└── ValueError # When an argument is of right type but inappropriate value.
1389-
└── UnicodeError # Raised when encoding/decoding strings from/to bytes fails.
1371+
+-- SystemExit # Raised by the sys.exit() function.
1372+
+-- KeyboardInterrupt # Raised when the user hits the interrupt key.
1373+
+-- Exception # User-defined exceptions should be derived from this class.
1374+
+-- StopIteration # Raised by next() when run on an empty iterator.
1375+
+-- ArithmeticError # Base class for arithmetic errors.
1376+
| +-- ZeroDivisionError # Raised when dividing by zero.
1377+
+-- AttributeError # Raised when an attribute is missing.
1378+
+-- EOFError # Raised by input() when it hits end-of-file condition.
1379+
+-- LookupError # Raised when a look-up on sequence or dict fails.
1380+
| +-- IndexError # Raised when a sequence index is out of range.
1381+
| +-- KeyError # Raised when a dictionary key is not found.
1382+
+-- NameError # Raised when a variable name is not found.
1383+
+-- OSError # Failures such as “file not found” or “disk full”.
1384+
| +-- FileNotFoundError # When a file or directory is requested but doesn't exist.
1385+
+-- RuntimeError # Raised by errors that don't fall in other categories.
1386+
| +-- RecursionError # Raised when the the maximum recursion depth is exceeded.
1387+
+-- TypeError # Raised when an argument is of wrong type.
1388+
+-- ValueError # When an argument is of right type but inappropriate value.
1389+
+-- UnicodeError # Raised when encoding/decoding strings from/to bytes fails.
13901390
```
13911391

13921392
### User-defined Exceptions

index.html

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1258,26 +1258,26 @@ <h4 id="reraisingcaughtexception">Re-raising caught exception:</h4>
12581258
<span class="hljs-keyword">raise</span>
12591259
</code></pre>
12601260
<h3 id="commonbuiltinexceptions">Common Built-in Exceptions</h3>
1261-
<pre><code class="python language-python hljs">BaseException
1262-
├── SystemExit <span class="hljs-comment"># Raised by the sys.exit() function.</span>
1263-
├── KeyboardInterrupt <span class="hljs-comment"># Raised when the user hits the interrupt key.</span>
1264-
└── Exception <span class="hljs-comment"># User-defined exceptions should be derived from this class.</span>
1265-
├── StopIteration <span class="hljs-comment"># Raised by next() when run on an empty iterator.</span>
1266-
├── ArithmeticError <span class="hljs-comment"># Base class for arithmetic errors.</span>
1267-
└── ZeroDivisionError <span class="hljs-comment"># Raised when dividing by zero.</span>
1268-
├── AttributeError <span class="hljs-comment"># Raised when an attribute is missing.</span>
1269-
├── EOFError <span class="hljs-comment"># Raised by input() when it hits end-of-file condition.</span>
1270-
├── LookupError <span class="hljs-comment"># Raised when a look-up on sequence or dict fails.</span>
1271-
├── IndexError <span class="hljs-comment"># Raised when a sequence index is out of range.</span>
1272-
└── KeyError <span class="hljs-comment"># Raised when a dictionary key is not found.</span>
1273-
├── NameError <span class="hljs-comment"># Raised when a variable name is not found.</span>
1274-
├── OSError <span class="hljs-comment"># Failures such as “file not found” or “disk full”.</span>
1275-
└── FileNotFoundError <span class="hljs-comment"># When a file or directory is requested but doesn't exist.</span>
1276-
├── RuntimeError <span class="hljs-comment"># Raised by errors that don't fall in other categories.</span>
1277-
└── RecursionError <span class="hljs-comment"># Raised when the the maximum recursion depth is exceeded.</span>
1278-
├── TypeError <span class="hljs-comment"># Raised when an argument is of wrong type.</span>
1279-
└── ValueError <span class="hljs-comment"># When an argument is of right type but inappropriate value.</span>
1280-
└── UnicodeError <span class="hljs-comment"># Raised when encoding/decoding strings from/to bytes fails.</span>
1261+
<pre><code class="text language-text">BaseException
1262+
+-- SystemExit # Raised by the sys.exit() function.
1263+
+-- KeyboardInterrupt # Raised when the user hits the interrupt key.
1264+
+-- Exception # User-defined exceptions should be derived from this class.
1265+
+-- StopIteration # Raised by next() when run on an empty iterator.
1266+
+-- ArithmeticError # Base class for arithmetic errors.
1267+
| +-- ZeroDivisionError # Raised when dividing by zero.
1268+
+-- AttributeError # Raised when an attribute is missing.
1269+
+-- EOFError # Raised by input() when it hits end-of-file condition.
1270+
+-- LookupError # Raised when a look-up on sequence or dict fails.
1271+
| +-- IndexError # Raised when a sequence index is out of range.
1272+
| +-- KeyError # Raised when a dictionary key is not found.
1273+
+-- NameError # Raised when a variable name is not found.
1274+
+-- OSError # Failures such as “file not found” or “disk full”.
1275+
| +-- FileNotFoundError # When a file or directory is requested but doesn't exist.
1276+
+-- RuntimeError # Raised by errors that don't fall in other categories.
1277+
| +-- RecursionError # Raised when the the maximum recursion depth is exceeded.
1278+
+-- TypeError # Raised when an argument is of wrong type.
1279+
+-- ValueError # When an argument is of right type but inappropriate value.
1280+
+-- UnicodeError # Raised when encoding/decoding strings from/to bytes fails.
12811281
</code></pre>
12821282
<h3 id="userdefinedexceptions">User-defined Exceptions</h3>
12831283
<pre><code class="python language-python hljs"><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">MyError</span><span class="hljs-params">(Exception)</span>:</span>

0 commit comments

Comments
 (0)