summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_userdict.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-02-11 06:12:03 (GMT)
committerGuido van Rossum <guido@python.org>2007-02-11 06:12:03 (GMT)
commitcc2b0161257495f859200bce0aea3ed7e646feb3 (patch)
treeba09aba0de6447bef5be59b43fb86d17d760833d /Lib/test/test_userdict.py
parent4e66dfcdc495218ad5f98b12ad6b4b2b05630ab0 (diff)
downloadcpython-cc2b0161257495f859200bce0aea3ed7e646feb3.zip
cpython-cc2b0161257495f859200bce0aea3ed7e646feb3.tar.gz
cpython-cc2b0161257495f859200bce0aea3ed7e646feb3.tar.bz2
- PEP 3106: dict.iterkeys(), .iteritems(), .itervalues() are now gone;
and .keys(), .items(), .values() return dict views. The dict views aren't fully functional yet; in particular, they can't be compared to sets yet. but they are useful as "iterator wells". There are still 27 failing unit tests; I expect that many of these have fairly trivial fixes, but there are so many, I could use help.
Diffstat (limited to 'Lib/test/test_userdict.py')
-rw-r--r--Lib/test/test_userdict.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/Lib/test/test_userdict.py b/Lib/test/test_userdict.py
index a7fc60a..05d6d9e 100644
--- a/Lib/test/test_userdict.py
+++ b/Lib/test/test_userdict.py
@@ -208,7 +208,7 @@ class SeqDict(UserDict.DictMixin):
if other is not None:
for (key, value) in other:
self[key] = value
- for (key, value) in kwargs.iteritems():
+ for (key, value) in kwargs.items():
self[key] = value
def __getitem__(self, key):
try:
@@ -234,7 +234,7 @@ class SeqDict(UserDict.DictMixin):
return list(self.keylist)
def copy(self):
d = self.__class__()
- for key, value in self.iteritems():
+ for key, value in self.items():
d[key] = value
return d
@classmethod
@@ -278,13 +278,13 @@ class UserDictMixinTest(mapping_tests.TestMappingProtocol):
self.assertEqual(len(s), 2)
# iteritems
- self.assertEqual(list(s.iteritems()), [(10,'ten'), (30, 'thirty')])
+ self.assertEqual(list(s.items()), [(10,'ten'), (30, 'thirty')])
# iterkeys
- self.assertEqual(list(s.iterkeys()), [10, 30])
+ self.assertEqual(list(s.keys()), [10, 30])
# itervalues
- self.assertEqual(list(s.itervalues()), ['ten', 'thirty'])
+ self.assertEqual(list(s.values()), ['ten', 'thirty'])
# values
self.assertEqual(s.values(), ['ten', 'thirty'])