diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2013-10-09 06:55:21 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2013-10-09 06:55:21 (GMT) |
commit | 3226d87747b4a9d3ecc7a5fec4797060eac7f7ab (patch) | |
tree | 8f3fba85a68ee27c35ecdbf7c9ace6880527b7c6 /Doc/tutorial/classes.rst | |
parent | 3d1b7a0c10d87d0b79b9ee41871de67470b6313b (diff) | |
parent | 91aaeac0508feebc0b7aa436e634892a472e7e93 (diff) | |
download | cpython-3226d87747b4a9d3ecc7a5fec4797060eac7f7ab.zip cpython-3226d87747b4a9d3ecc7a5fec4797060eac7f7ab.tar.gz cpython-3226d87747b4a9d3ecc7a5fec4797060eac7f7ab.tar.bz2 |
Issue #19193: Improved cross-references in the tutorial.
Diffstat (limited to 'Doc/tutorial/classes.rst')
-rw-r--r-- | Doc/tutorial/classes.rst | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Doc/tutorial/classes.rst b/Doc/tutorial/classes.rst index 291410a..08072a3 100644 --- a/Doc/tutorial/classes.rst +++ b/Doc/tutorial/classes.rst @@ -652,7 +652,7 @@ will do nicely:: 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 @@ -738,8 +738,8 @@ 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:`~iterator.__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. You can call the :meth:`__next__` method +:meth:`~iterator.__next__` raises a :exc:`StopIteration` exception which tells the +:keyword:`for` loop to terminate. You can call the :meth:`~iterator.__next__` method using the :func:`next` built-in function; this example shows how it all works:: >>> s = 'abc' |