Doc/tutorial/datastructures.rst | 10 +++++----- Doc/tutorial/modules.rst | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Doc/tutorial/datastructures.rst b/Doc/tutorial/datastructures.rst index 84e731d..95a6846 100644 --- a/Doc/tutorial/datastructures.rst +++ b/Doc/tutorial/datastructures.rst @@ -440,10 +440,10 @@ 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. -The :meth:`keys` method of a dictionary object 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 -in the dictionary, use the :keyword:`in` keyword. +The :meth:`keys` method of a dictionary object returns a set-like view (see +:ref:`dict-views`) of all the keys used in the dictionary, in arbitrary order +(if you want it sorted, just use the :func:`sorted` function). To check whether +a single key is in the dictionary, use the :keyword:`in` keyword. Here is a small example using a dictionary:: @@ -457,7 +457,7 @@ Here is a small example using a dictionary:: >>> tel['irv'] = 4127 >>> tel {'guido': 4127, 'irv': 4127, 'jack': 4098} - >>> list(tel.keys()) + >>> sorted(tel.keys()) ['guido', 'irv', 'jack'] >>> 'guido' in tel True diff --git a/Doc/tutorial/modules.rst b/Doc/tutorial/modules.rst index 1b3cbc5..f73fcf9 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:`reload` in module :mod:`imp`, e.g. ``imp.reload(modulename)``. .. _tut-modulesasscripts: