[Python-3000-checkins] r53747 - python/branches/p3yk/Lib/mailbox.py
guido.van.rossum
python-3000-checkins at python.org
Mon Feb 12 01:22:56 CET 2007
Author: guido.van.rossum
Date: Mon Feb 12 01:22:55 2007
New Revision: 53747
Modified:
python/branches/p3yk/Lib/mailbox.py
Log:
Fix another unit test.
Modified: python/branches/p3yk/Lib/mailbox.py
==============================================================================
--- python/branches/p3yk/Lib/mailbox.py (original)
+++ python/branches/p3yk/Lib/mailbox.py Mon Feb 12 01:22:55 2007
@@ -95,7 +95,7 @@
def keys(self):
"""Return a list of keys."""
- return list(self.keys())
+ return list(self.iterkeys())
def itervalues(self):
"""Return an iterator over all messages."""
@@ -111,7 +111,7 @@
def values(self):
"""Return a list of messages. Memory intensive."""
- return list(self.values())
+ return list(self.itervalues())
def iteritems(self):
"""Return an iterator over (key, message) tuples."""
@@ -124,7 +124,7 @@
def items(self):
"""Return a list of (key, message) tuples. Memory intensive."""
- return list(self.items())
+ return list(self.iteritems())
def __contains__(self, key):
"""Return True if the keyed message exists, False otherwise."""
@@ -477,7 +477,7 @@
def next(self):
"""Return the next message in a one-time iteration."""
if not hasattr(self, '_onetime_keys'):
- self._onetime_keys = self.keys()
+ self._onetime_keys = iter(self.keys())
while True:
try:
return self[self._onetime_keys.next()]
More information about the Python-3000-checkins
mailing list