]> granicus.if.org Git - python/commitdiff
Minor factoring.
authorRaymond Hettinger <python@rcn.com>
Wed, 8 Apr 2009 08:26:55 +0000 (08:26 +0000)
committerRaymond Hettinger <python@rcn.com>
Wed, 8 Apr 2009 08:26:55 +0000 (08:26 +0000)
Lib/collections.py

index 7b207e3731a3b5dd1ed6acce8b6ffe8786506b76..4cffca00f5c43ddb23e1df278e2e22008945a0c1 100644 (file)
@@ -126,7 +126,7 @@ class OrderedDict(dict, MutableMapping):
         '''
         if not self:
             raise KeyError('dictionary is empty')
-        key = next(reversed(self)) if last else next(iter(self))
+        key = next(reversed(self) if last else iter(self))
         value = self.pop(key)
         return key, value