summaryrefslogtreecommitdiffstats
path: root/Doc
diff options
context:
space:
mode:
authorGeorg Brandl <georg@python.org>2008-12-15 08:28:37 (GMT)
committerGeorg Brandl <georg@python.org>2008-12-15 08:28:37 (GMT)
commitabffe71dc1be222b9b9b203ded10d265ca39ef9d (patch)
tree5e47930853f8a04eb484e3149d9d9064637b84e4 /Doc
parent8206695c4b75e8db8d6d750dc5ba74cf8dfb31b4 (diff)
downloadcpython-abffe71dc1be222b9b9b203ded10d265ca39ef9d.zip
cpython-abffe71dc1be222b9b9b203ded10d265ca39ef9d.tar.gz
cpython-abffe71dc1be222b9b9b203ded10d265ca39ef9d.tar.bz2
#4667: fix some 2.x leftovers in the tutorial.
Diffstat (limited to 'Doc')
-rw-r--r--Doc/tutorial/datastructures.rst6
-rw-r--r--Doc/tutorial/modules.rst2
2 files changed, 5 insertions, 3 deletions
diff --git a/Doc/tutorial/datastructures.rst b/Doc/tutorial/datastructures.rst
index 0661164..ca6de17 100644
--- a/Doc/tutorial/datastructures.rst
+++ b/Doc/tutorial/datastructures.rst
@@ -440,9 +440,9 @@ pair with ``del``. If you store using a key that is already in use, the old
value associated with that key is forgotten. It is an error to extract a value
using a non-existent key.
-Preforming ``list(d.keys())`` on a dictionary returns a list of all the keys
+Performing ``list(d.keys())`` on a dictionary returns a list of all the keys
used in the dictionary, in arbitrary order (if you want it sorted, just apply
-the :meth:`sort` method to the list of keys). To check whether a single key is
+the :meth:`sorted` function instead). To check whether a single key is
in the dictionary, use the :keyword:`in` keyword.
Here is a small example using a dictionary::
@@ -458,6 +458,8 @@ Here is a small example using a dictionary::
>>> tel
{'guido': 4127, 'irv': 4127, 'jack': 4098}
>>> list(tel.keys())
+ ['irv', 'guido', 'jack']
+ >>> sorted(tel.keys())
['guido', 'irv', 'jack']
>>> 'guido' in tel
True
diff --git a/Doc/tutorial/modules.rst b/Doc/tutorial/modules.rst
index 1b3cbc5..aca553d 100644
--- a/Doc/tutorial/modules.rst
+++ b/Doc/tutorial/modules.rst
@@ -112,7 +112,7 @@ you have already defined.
For efficiency reasons, each module is only imported once per interpreter
session. Therefore, if you change your modules, you must restart the
interpreter -- or, if it's just one module you want to test interactively,
- use :func:`reload`, e.g. ``reload(modulename)``.
+ use :func:`imp.reload`, e.g. ``import imp; imp.reload(modulename)``.
.. _tut-modulesasscripts: