Skip to content

Commit b2fdaa7

Browse files
committed
Context manager
1 parent bf2959a commit b2fdaa7

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1167,8 +1167,8 @@ Hello World!
11671167

11681168
#### List of existing context managers:
11691169
```python
1170-
with open('<path>', ...) as file: ...
1171-
with wave.open('<path>', ...) as wave_file: ...
1170+
with open('<path>') as file: ...
1171+
with wave.open('<path>') as wave_file: ...
11721172
with memoryview(<bytes/bytearray/array>) as view: ...
11731173
db = sqlite3.connect('<path>'); with db: db.execute('<insert_query>')
11741174
lock = threading.RLock(); with lock: ...

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1095,8 +1095,8 @@
10951095
<span class="hljs-meta">... </span> print(file.read())
10961096
Hello World!
10971097
</code></pre>
1098-
<div><h4 id="listofexistingcontextmanagers">List of existing context managers:</h4><pre><code class="python language-python hljs"><span class="hljs-keyword">with</span> open(<span class="hljs-string">'&lt;path&gt;'</span>, ...) <span class="hljs-keyword">as</span> file: ...
1099-
<span class="hljs-keyword">with</span> wave.open(<span class="hljs-string">'&lt;path&gt;'</span>, ...) <span class="hljs-keyword">as</span> wave_file: ...
1098+
<div><h4 id="listofexistingcontextmanagers">List of existing context managers:</h4><pre><code class="python language-python hljs"><span class="hljs-keyword">with</span> open(<span class="hljs-string">'&lt;path&gt;'</span>) <span class="hljs-keyword">as</span> file: ...
1099+
<span class="hljs-keyword">with</span> wave.open(<span class="hljs-string">'&lt;path&gt;'</span>) <span class="hljs-keyword">as</span> wave_file: ...
11001100
<span class="hljs-keyword">with</span> memoryview(&lt;bytes/bytearray/array&gt;) <span class="hljs-keyword">as</span> view: ...
11011101
db = sqlite3.connect(<span class="hljs-string">'&lt;path&gt;'</span>); <span class="hljs-keyword">with</span> db: db.execute(<span class="hljs-string">'&lt;insert_query&gt;'</span>)
11021102
lock = threading.RLock(); <span class="hljs-keyword">with</span> lock: ...

0 commit comments

Comments
 (0)