Merged revisions 74762 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
........
r74762 | ezio.melotti | 2009-09-13 07:48:45 +0300 (Sun, 13 Sep 2009) | 1 line
more list()s on dictviews
........
diff --git a/Doc/library/collections.rst b/Doc/library/collections.rst
index d7907b0..cd38956 100644
--- a/Doc/library/collections.rst
+++ b/Doc/library/collections.rst
@@ -669,7 +669,7 @@
'Return a new Point object replacing specified fields with new values'
result = _self._make(map(kwds.pop, ('x', 'y'), _self))
if kwds:
- raise ValueError('Got unexpected field names: %r' % kwds.keys())
+ raise ValueError('Got unexpected field names: %r' % list(kwds.keys()))
return result
<BLANKLINE>
def __getnewargs__(self):
diff --git a/Doc/library/doctest.rst b/Doc/library/doctest.rst
index 2d0f48a..2aa3ae1 100644
--- a/Doc/library/doctest.rst
+++ b/Doc/library/doctest.rst
@@ -701,8 +701,7 @@
instead. Another is to do ::
- >>> d = foo().items()
- >>> d.sort()
+ >>> d = sorted(foo().items())
>>> d
[('Harry', 'broomstick'), ('Hermione', 'hippogryph')]
diff --git a/Doc/library/modulefinder.rst b/Doc/library/modulefinder.rst
index 6db02ff..41b387b 100644
--- a/Doc/library/modulefinder.rst
+++ b/Doc/library/modulefinder.rst
@@ -84,7 +84,7 @@
print('Loaded modules:')
for name, mod in finder.modules.items():
print('%s: ' % name, end='')
- print(','.join(mod.globalnames.keys()[:3]))
+ print(','.join(list(mod.globalnames.keys())[:3]))
print('-'*50)
print('Modules not imported:')
diff --git a/Doc/library/shelve.rst b/Doc/library/shelve.rst
index 35ed84c..10242fd 100644
--- a/Doc/library/shelve.rst
+++ b/Doc/library/shelve.rst
@@ -141,8 +141,8 @@
# such key)
del d[key] # delete data stored at key (raises KeyError
# if no such key)
- flag = key in d # true if the key exists
- klist = d.keys() # a list of all existing keys (slow!)
+ flag = key in d # true if the key exists
+ klist = list(d.keys()) # a list of all existing keys (slow!)
# as d was opened WITHOUT writeback=True, beware:
d['xx'] = range(4) # this works as expected, but...