Browse Source

Context manager

pull/52/head
Jure Šorn 5 years ago
parent
commit
e0d9bb1877
2 changed files with 2 additions and 2 deletions
  1. 2
      README.md
  2. 2
      index.html

2
README.md

@ -1169,7 +1169,7 @@ class Counter:
```
### Context Manager
* **Enter() should lock the resources and return an object.**
* **Enter() should lock the resources and (optionally) return an object.**
* **Exit() should release the resources.**
* **Any exception that happens inside the with block is passed to the exit() method.**
* **If it wishes to suppress the exception it must return a true value.**

2
index.html

@ -1113,7 +1113,7 @@ Z = dataclasses.make_dataclass(<span class="hljs-string">'Z'</span>, [<span clas
(<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>)
</code></pre>
<div><h3 id="contextmanager">Context Manager</h3><ul>
<li><strong>Enter() should lock the resources and return an object.</strong></li>
<li><strong>Enter() should lock the resources and (optionally) return an object.</strong></li>
<li><strong>Exit() should release the resources.</strong></li>
<li><strong>Any exception that happens inside the with block is passed to the exit() method.</strong></li>
<li><strong>If it wishes to suppress the exception it must return a true value.</strong> </li>

|||||||
100:0
Loading…
Cancel
Save