From aaace2610cc20df7f99c517772742ec47f3cd9a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jure=20=C5=A0orn?= Date: Fri, 17 Apr 2020 15:44:53 +0200 Subject: [PATCH] Duck types --- README.md | 2 +- index.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ae9c601..c374319 100644 --- a/README.md +++ b/README.md @@ -1175,7 +1175,7 @@ class Counter: * **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.** ```python -class MyOpen(): +class MyOpen: def __init__(self, filename): self.filename = filename def __enter__(self): diff --git a/index.html b/index.html index 286567a..8b9ed87 100644 --- a/index.html +++ b/index.html @@ -1120,7 +1120,7 @@ Z = dataclasses.make_dataclass('Z', [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.
  • -
    class MyOpen():
    +
    class MyOpen:
         def __init__(self, filename):
             self.filename = filename
         def __enter__(self):