Mercurial > cpython-lru_cache-weakref
diff Doc/tutorial/classes.rst @ 86170:ac826284fdd1 2.7
Issue #19193: Improved cross-references in the tutorial.
| author | Serhiy Storchaka <storchaka@gmail.com> |
|---|---|
| date | Wed, 09 Oct 2013 09:54:32 +0300 |
| parents | 29627bd5b333 |
| children |
line wrap: on
line diff
--- a/Doc/tutorial/classes.rst Tue Oct 08 21:51:06 2013 -0500 +++ b/Doc/tutorial/classes.rst Wed Oct 09 09:54:32 2013 +0300 @@ -609,7 +609,7 @@ A piece of Python code that expects a particular abstract data type can often be passed a class that emulates the methods of that data type instead. For instance, if you have a function that formats some data from a file object, you -can define a class with methods :meth:`read` and :meth:`readline` that get the +can define a class with methods :meth:`read` and :meth:`!readline` that get the data from a string buffer instead, and pass it as an argument. .. (Unfortunately, this technique has its limitations: a class can't define @@ -693,9 +693,10 @@ This style of access is clear, concise, and convenient. The use of iterators pervades and unifies Python. Behind the scenes, the :keyword:`for` statement calls :func:`iter` on the container object. The function returns an iterator -object that defines the method :meth:`next` which accesses elements in the -container one at a time. When there are no more elements, :meth:`next` raises a -:exc:`StopIteration` exception which tells the :keyword:`for` loop to terminate. +object that defines the method :meth:`~iterator.next` which accesses elements +in the container one at a time. When there are no more elements, +:meth:`~iterator.next` raises a :exc:`StopIteration` exception which tells the +:keyword:`for` loop to terminate. This example shows how it all works:: >>> s = 'abc'
