Skip to content

Commit 0bb5d44

Browse files
committed
Enum, Exceptions
1 parent 222277f commit 0bb5d44

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

README.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1340,8 +1340,8 @@ class <enum_name>(Enum):
13401340
<member_name> = <value> # Values don't have to be hashable.
13411341
<member_name> = <value>, <value> # Tuple can be used for multiple values.
13421342
```
1343-
* **Accessing a member named after a reserved keyword causes SyntaxError.**
13441343
* **Methods receive the member they were called on as the 'self' argument.**
1344+
* **Accessing a member named after a reserved keyword causes SyntaxError.**
13451345

13461346
```python
13471347
<member> = <enum>.<member_name> # Returns a member.
@@ -1402,8 +1402,7 @@ finally:
14021402
```
14031403
* **Code inside the `'else'` block will only be executed if `'try'` block had no exceptions.**
14041404
* **Code inside the `'finally'` block will always be executed (unless a signal is received).**
1405-
* **All variables that are initialized in executed blocks are also visible in all subsequent blocks
1406-
, as well as outside the try statement (only function block delimits scope).**
1405+
* **All variables that are initialized in executed blocks are also visible in all subsequent blocks, as well as outside the try statement (only function block delimits scope).**
14071406
* **To catch signals use `'signal.signal(signal_number, <func>)'`.**
14081407

14091408
### Catching Exceptions

index.html

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,8 +1145,8 @@
11451145
&lt;member_name&gt; = &lt;value&gt;, &lt;value&gt; <span class="hljs-comment"># Tuple can be used for multiple values.</span>
11461146
</code></pre>
11471147
<ul>
1148-
<li><strong>Accessing a member named after a reserved keyword causes SyntaxError.</strong></li>
11491148
<li><strong>Methods receive the member they were called on as the 'self' argument.</strong></li>
1149+
<li><strong>Accessing a member named after a reserved keyword causes SyntaxError.</strong></li>
11501150
</ul>
11511151
<pre><code class="python language-python hljs">&lt;member&gt; = &lt;enum&gt;.&lt;member_name&gt; <span class="hljs-comment"># Returns a member.</span>
11521152
&lt;member&gt; = &lt;enum&gt;[<span class="hljs-string">'&lt;member_name&gt;'</span>] <span class="hljs-comment"># Returns a member. Raises KeyError.</span>
@@ -1193,8 +1193,7 @@
11931193
<ul>
11941194
<li><strong>Code inside the <code class="python hljs"><span class="hljs-string">'else'</span></code> block will only be executed if <code class="python hljs"><span class="hljs-string">'try'</span></code> block had no exceptions.</strong></li>
11951195
<li><strong>Code inside the <code class="python hljs"><span class="hljs-string">'finally'</span></code> block will always be executed (unless a signal is received).</strong></li>
1196-
<li><strong>All variables that are initialized in executed blocks are also visible in all subsequent blocks
1197-
, as well as outside the try statement (only function block delimits scope).</strong></li>
1196+
<li><strong>All variables that are initialized in executed blocks are also visible in all subsequent blocks, as well as outside the try statement (only function block delimits scope).</strong></li>
11981197
<li><strong>To catch signals use <code class="python hljs"><span class="hljs-string">'signal.signal(signal_number, &lt;func&gt;)'</span></code>.</strong></li>
11991198
</ul>
12001199
<div><h3 id="catchingexceptions">Catching Exceptions</h3><pre><code class="python language-python hljs"><span class="hljs-keyword">except</span> &lt;exception&gt;: ...

0 commit comments

Comments
 (0)