Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
abffe71d
Commit
abffe71d
authored
Dec 15, 2008
by
Georg Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
#4667: fix some 2.x leftovers in the tutorial.
parent
8206695c
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
3 deletions
+5
-3
Doc/tutorial/datastructures.rst
Doc/tutorial/datastructures.rst
+4
-2
Doc/tutorial/modules.rst
Doc/tutorial/modules.rst
+1
-1
No files found.
Doc/tutorial/datastructures.rst
View file @
abffe71d
...
...
@@ -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.
P
re
forming ``list(d.keys())`` on a dictionary returns a list of all the keys
P
er
forming ``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:`sort
ed` 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
...
...
Doc/tutorial/modules.rst
View file @
abffe71d
...
...
@@ -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:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment