Skip to content

Commit aaace26

Browse files
committed
Duck types
1 parent f58b9cc commit aaace26

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1175,7 +1175,7 @@ class Counter:
11751175
* **Any exception that happens inside the with block is passed to the exit() method.**
11761176
* **If it wishes to suppress the exception it must return a true value.**
11771177
```python
1178-
class MyOpen():
1178+
class MyOpen:
11791179
def __init__(self, filename):
11801180
self.filename = filename
11811181
def __enter__(self):

index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1120,7 +1120,7 @@
11201120
<li><strong>Exit() should release the resources.</strong></li>
11211121
<li><strong>Any exception that happens inside the with block is passed to the exit() method.</strong></li>
11221122
<li><strong>If it wishes to suppress the exception it must return a true value.</strong> </li>
1123-
</ul><pre><code class="python language-python hljs"><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">MyOpen</span><span class="hljs-params">()</span>:</span>
1123+
</ul><pre><code class="python language-python hljs"><span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">MyOpen</span>:</span>
11241124
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">__init__</span><span class="hljs-params">(self, filename)</span>:</span>
11251125
self.filename = filename
11261126
<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">__enter__</span><span class="hljs-params">(self)</span>:</span>

0 commit comments

Comments
 (0)