diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2013-10-13 20:12:09 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2013-10-13 20:12:09 (GMT) |
commit | 98b28fddd8e63e1a9410facee3e41925eed8ac46 (patch) | |
tree | 410d277cbb20078d5fd226e8dd4d24bd225237d8 /Doc/library/abc.rst | |
parent | 6039db8de30b5c20ba864cc4127fbfabf6fc0641 (diff) | |
parent | bfdcd436f0410e2b3eb34ce4fd7411488d3f13fb (diff) | |
download | cpython-98b28fddd8e63e1a9410facee3e41925eed8ac46.zip cpython-98b28fddd8e63e1a9410facee3e41925eed8ac46.tar.gz cpython-98b28fddd8e63e1a9410facee3e41925eed8ac46.tar.bz2 |
Issue #18758: Fixed and improved cross-references.
Diffstat (limited to 'Doc/library/abc.rst')
-rw-r--r-- | Doc/library/abc.rst | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/Doc/library/abc.rst b/Doc/library/abc.rst index 1f21b57..7853d31 100644 --- a/Doc/library/abc.rst +++ b/Doc/library/abc.rst @@ -114,19 +114,19 @@ This module provides the following classes: MyIterable.register(Foo) The ABC ``MyIterable`` defines the standard iterable method, - :meth:`__iter__`, as an abstract method. The implementation given here can - still be called from subclasses. The :meth:`get_iterator` method is also - part of the ``MyIterable`` abstract base class, but it does not have to be - overridden in non-abstract derived classes. + :meth:`~iterator.__iter__`, as an abstract method. The implementation given + here can still be called from subclasses. The :meth:`get_iterator` method + is also part of the ``MyIterable`` abstract base class, but it does not have + to be overridden in non-abstract derived classes. The :meth:`__subclasshook__` class method defined here says that any class - that has an :meth:`__iter__` method in its :attr:`__dict__` (or in that of - one of its base classes, accessed via the :attr:`__mro__` list) is - considered a ``MyIterable`` too. + that has an :meth:`~iterator.__iter__` method in its + :attr:`~object.__dict__` (or in that of one of its base classes, accessed + via the :attr:`~class.__mro__` list) is considered a ``MyIterable`` too. Finally, the last line makes ``Foo`` a virtual subclass of ``MyIterable``, - even though it does not define an :meth:`__iter__` method (it uses the - old-style iterable protocol, defined in terms of :meth:`__len__` and + even though it does not define an :meth:`~iterator.__iter__` method (it uses + the old-style iterable protocol, defined in terms of :meth:`__len__` and :meth:`__getitem__`). Note that this will not make ``get_iterator`` available as a method of ``Foo``, so it is provided separately. |