Skip to content

Commit f42080c

Browse files
committed
Exceptions
1 parent 6064116 commit f42080c

File tree

3 files changed

+15
-15
lines changed

3 files changed

+15
-15
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1384,25 +1384,25 @@ raise <exception>(<el>)
13841384
raise <exception>(<el>, ...)
13851385
```
13861386

1387-
#### Useful built-in exceptions:
1388-
```python
1389-
raise ValueError('Argument is of right type but inappropriate value!')
1390-
raise TypeError('Argument is of wrong type!')
1391-
raise RuntimeError('None of above!')
1392-
```
1393-
13941387
#### Re-raising caught exception:
13951388
```python
13961389
except <exception>:
13971390
<code>
13981391
raise
13991392
```
14001393

1394+
#### Useful built-in exceptions:
1395+
```python
1396+
raise ValueError('Argument is of right type but inappropriate value!')
1397+
raise TypeError('Argument is of wrong type!')
1398+
raise RuntimeError('None of above!')
1399+
```
1400+
14011401
### Common Built-in Exceptions
14021402
```text
14031403
BaseException
14041404
+-- SystemExit # Raised by the sys.exit() function.
1405-
+-- KeyboardInterrupt # Raised when the user hits the interrupt key.
1405+
+-- KeyboardInterrupt # Raised when the user hits the interrupt key (ctrl-c).
14061406
+-- Exception # User-defined exceptions should be derived from this class.
14071407
+-- StopIteration # Raised by next() when run on an empty iterator.
14081408
+-- ArithmeticError # Base class for arithmetic errors.

index.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1297,19 +1297,19 @@
12971297
<span class="hljs-keyword">raise</span> &lt;exception&gt;(&lt;el&gt;, ...)
12981298
</code></pre></div>
12991299

1300-
<div><h4 id="usefulbuiltinexceptions">Useful built-in exceptions:</h4><pre><code class="python language-python hljs"><span class="hljs-keyword">raise</span> ValueError(<span class="hljs-string">'Argument is of right type but inappropriate value!'</span>)
1301-
<span class="hljs-keyword">raise</span> TypeError(<span class="hljs-string">'Argument is of wrong type!'</span>)
1302-
<span class="hljs-keyword">raise</span> RuntimeError(<span class="hljs-string">'None of above!'</span>)
1303-
</code></pre></div>
1304-
13051300
<div><h4 id="reraisingcaughtexception">Re-raising caught exception:</h4><pre><code class="python language-python hljs"><span class="hljs-keyword">except</span> &lt;exception&gt;:
13061301
&lt;code&gt;
13071302
<span class="hljs-keyword">raise</span>
13081303
</code></pre></div>
13091304

1305+
<div><h4 id="usefulbuiltinexceptions">Useful built-in exceptions:</h4><pre><code class="python language-python hljs"><span class="hljs-keyword">raise</span> ValueError(<span class="hljs-string">'Argument is of right type but inappropriate value!'</span>)
1306+
<span class="hljs-keyword">raise</span> TypeError(<span class="hljs-string">'Argument is of wrong type!'</span>)
1307+
<span class="hljs-keyword">raise</span> RuntimeError(<span class="hljs-string">'None of above!'</span>)
1308+
</code></pre></div>
1309+
13101310
<div><h3 id="commonbuiltinexceptions">Common Built-in Exceptions</h3><pre><code class="text language-text">BaseException
13111311
+-- SystemExit # Raised by the sys.exit() function.
1312-
+-- KeyboardInterrupt # Raised when the user hits the interrupt key.
1312+
+-- KeyboardInterrupt # Raised when the user hits the interrupt key (ctrl-c).
13131313
+-- Exception # User-defined exceptions should be derived from this class.
13141314
+-- StopIteration # Raised by next() when run on an empty iterator.
13151315
+-- ArithmeticError # Base class for arithmetic errors.

web/script_2.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ const DIAGRAM_8_A =
125125
const DIAGRAM_8_B =
126126
"BaseException\n" +
127127
" ├── SystemExit <span class='hljs-comment'># Raised by the sys.exit() function.</span>\n" +
128-
" ├── KeyboardInterrupt <span class='hljs-comment'># Raised when the user hits the interrupt key.</span>\n" +
128+
" ├── KeyboardInterrupt <span class='hljs-comment'># Raised when the user hits the interrupt key (ctrl-c).</span>\n" +
129129
" └── Exception <span class='hljs-comment'># User-defined exceptions should be derived from this class.</span>\n" +
130130
" ├── StopIteration <span class='hljs-comment'># Raised by next() when run on an empty iterator.</span>\n" +
131131
" ├── ArithmeticError <span class='hljs-comment'># Base class for arithmetic errors.</span>\n" +

0 commit comments

Comments
 (0)