You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+6-6Lines changed: 6 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2144,8 +2144,8 @@ match <object/expression>:
2144
2144
***Sequence pattern can also be written as a tuple, either with or without the brackets.**
2145
2145
***Use `'*<name>'` and `'**<name>'` in sequence/mapping patterns to bind remaining items.**
2146
2146
***Sequence pattern must match all items of the collection, while mapping pattern does not.**
2147
-
***Patterns can be surrounded with brackets to override their precedence: `'|'` > `'as'` > `','`. For example, `'[1, 2]'`gets caught by the `'case 1|2, 2|3 as x if x == 2:'`clause.**
2148
-
***All names that are bound in the matching case, as well as variables initialized in its block, are visible after the match statement (only the function block delimits scope).**
2147
+
***Patterns can be surrounded with brackets to override their precedence: `'|'` > `'as'` > `','`. For example, `'[1, 2]'`is matched by the `'case 1|2, 2|3 as x if x == 2:'`block.**
2148
+
***All names that are bound in the matching case, as well as variables initialized in its body, are visible after the match statement (only function block delimits scope).**
2149
2149
2150
2150
### Example
2151
2151
```python
@@ -2185,10 +2185,10 @@ log.basicConfig(
2185
2185
2186
2186
```python
2187
2187
<Formatter>= log.Formatter('<format>') # Formats messages according to format str.
2188
-
<Handler>= log.FileHandler(<path>, mode='a') #Creates a handler. Also `encoding=None`.
2189
-
<Handler>.setFormatter(<Formatter>) #Assigns the formatter to the handler.
2190
-
<Handler>.setLevel(<int/str>) #It will process all messages by default.
2191
-
<Logger>.addHandler(<Handler>) #Appends handler to logger's 'handlers'.
2188
+
<Handler>= log.FileHandler(<path>, mode='a') #Appends to file. Also `encoding=None`.
2189
+
<Handler>.setFormatter(<Formatter>) #Only outputs bare messages by default.
2190
+
<Handler>.setLevel(<int/str>) #Prints or saves every message by default.
2191
+
<Logger>.addHandler(<Handler>) #Logger can have more than one handler.
2192
2192
<Logger>.setLevel(<int/str>) # What is sent to its/ancestors' handlers.
2193
2193
<Logger>.propagate =<bool># Cuts off ancestors' handlers if False.
<li><strong>Sequence pattern can also be written as a tuple, either with or without the brackets.</strong></li>
1776
1776
<li><strong>Use <codeclass="python hljs"><spanclass="hljs-string">'*<name>'</span></code> and <codeclass="python hljs"><spanclass="hljs-string">'**<name>'</span></code> in sequence/mapping patterns to bind remaining items.</strong></li>
1777
1777
<li><strong>Sequence pattern must match all items of the collection, while mapping pattern does not.</strong></li>
1778
-
<li><strong>Patterns can be surrounded with brackets to override their precedence: <codeclass="python hljs"><spanclass="hljs-string">'|'</span></code> > <codeclass="python hljs"><spanclass="hljs-string">'as'</span></code> > <codeclass="python hljs"><spanclass="hljs-string">','</span></code>. For example, <codeclass="python hljs"><spanclass="hljs-string">'[1, 2]'</span></code>gets caught by the <codeclass="python hljs"><spanclass="hljs-string">'case 1|2, 2|3 as x if x == 2:'</span></code>clause.</strong></li>
1779
-
<li><strong>All names that are bound in the matching case, as well as variables initialized in its block, are visible after the match statement (only the function block delimits scope).</strong></li>
1778
+
<li><strong>Patterns can be surrounded with brackets to override their precedence: <codeclass="python hljs"><spanclass="hljs-string">'|'</span></code> > <codeclass="python hljs"><spanclass="hljs-string">'as'</span></code> > <codeclass="python hljs"><spanclass="hljs-string">','</span></code>. For example, <codeclass="python hljs"><spanclass="hljs-string">'[1, 2]'</span></code>is matched by the <codeclass="python hljs"><spanclass="hljs-string">'case 1|2, 2|3 as x if x == 2:'</span></code>block.</strong></li>
1779
+
<li><strong>All names that are bound in the matching case, as well as variables initialized in its body, are visible after the match statement (only function block delimits scope).</strong></li>
<pre><codeclass="python language-python hljs"><Formatter> = log.Formatter(<spanclass="hljs-string">'<format>'</span>) <spanclass="hljs-comment"># Formats messages according to format str.</span>
1808
-
<Handler> = log.FileHandler(<path>, mode=<spanclass="hljs-string">'a'</span>) <spanclass="hljs-comment"># Creates a handler. Also `encoding=None`.</span>
1809
-
<Handler>.setFormatter(<Formatter>) <spanclass="hljs-comment"># Assigns the formatter to the handler.</span>
1810
-
<Handler>.setLevel(<int/str>) <spanclass="hljs-comment"># It will process all messages by default.</span>
1811
-
<Logger>.addHandler(<Handler>) <spanclass="hljs-comment"># Appends handler to logger's 'handlers'.</span>
1808
+
<Handler> = log.FileHandler(<path>, mode=<spanclass="hljs-string">'a'</span>) <spanclass="hljs-comment"># Appends to file. Also `encoding=None`.</span>
1809
+
<Handler>.setFormatter(<Formatter>) <spanclass="hljs-comment"># Only outputs bare messages by default.</span>
1810
+
<Handler>.setLevel(<int/str>) <spanclass="hljs-comment"># Prints or saves every message by default.</span>
1811
+
<Logger>.addHandler(<Handler>) <spanclass="hljs-comment"># Logger can have more than one handler.</span>
1812
1812
<Logger>.setLevel(<int/str>) <spanclass="hljs-comment"># What is sent to its/ancestors' handlers.</span>
1813
1813
<Logger>.propagate = <bool> <spanclass="hljs-comment"># Cuts off ancestors' handlers if False.</span>
0 commit comments