Skip to content

Commit 44d9d01

Browse files
author
Scott Sanderson
committed
DOC: More doc updates.
1 parent e8ee7bb commit 44d9d01

File tree

1 file changed

+14
-16
lines changed

1 file changed

+14
-16
lines changed

README.rst

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,22 @@ asserting that classes implement those interfaces.
1919

2020
.. code-block:: python
2121
22-
from abc import ABCMeta, abstractmethod
23-
24-
class Base(metaclass=ABCMeta):
25-
26-
@abstractmethod
27-
def method(self, a, b):
28-
pass
29-
30-
class Implementation(MyABC):
31-
32-
def method(self):
33-
return "This shouldn't work."
34-
35-
impl = Implementation()
22+
>>> from abc import ABCMeta, abstractmethod
23+
>>> class Base(metaclass=ABCMeta):
24+
... @abstractmethod
25+
... def method(self, a, b):
26+
... pass
27+
...
28+
>>> class Implementation(MyABC):
29+
... def method(self):
30+
... return "This shouldn't work."
31+
...
32+
>>> impl = Implementation()
33+
>>>
3634
3735
The equivalent code using ``interface`` produces an error indicating that
38-
the signature of ``Implementation.method`` is incompatible with that of
39-
``Base.method``.
36+
the signature of our implementation method is incompatible with the
37+
signature of our interface declaration:
4038

4139
.. code-block:: python
4240

0 commit comments

Comments
 (0)