Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit abffe71

Browse files
committed
#4667: fix some 2.x leftovers in the tutorial.
1 parent 8206695 commit abffe71

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

Doc/tutorial/datastructures.rst

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,9 +440,9 @@ pair with ``del``. If you store using a key that is already in use, the old
440440
value associated with that key is forgotten. It is an error to extract a value
441441
using a non-existent key.
442442

443-
Preforming ``list(d.keys())`` on a dictionary returns a list of all the keys
443+
Performing ``list(d.keys())`` on a dictionary returns a list of all the keys
444444
used in the dictionary, in arbitrary order (if you want it sorted, just apply
445-
the :meth:`sort` method to the list of keys). To check whether a single key is
445+
the :meth:`sorted` function instead). To check whether a single key is
446446
in the dictionary, use the :keyword:`in` keyword.
447447

448448
Here is a small example using a dictionary::
@@ -458,6 +458,8 @@ Here is a small example using a dictionary::
458458
>>> tel
459459
{'guido': 4127, 'irv': 4127, 'jack': 4098}
460460
>>> list(tel.keys())
461+
['irv', 'guido', 'jack']
462+
>>> sorted(tel.keys())
461463
['guido', 'irv', 'jack']
462464
>>> 'guido' in tel
463465
True

Doc/tutorial/modules.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ you have already defined.
112112
For efficiency reasons, each module is only imported once per interpreter
113113
session. Therefore, if you change your modules, you must restart the
114114
interpreter -- or, if it's just one module you want to test interactively,
115-
use :func:`reload`, e.g. ``reload(modulename)``.
115+
use :func:`imp.reload`, e.g. ``import imp; imp.reload(modulename)``.
116116

117117

118118
.. _tut-modulesasscripts:

0 commit comments

Comments
 (0)