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

index 3c1b78a3668a6c329ec1fe2b23212d9c200d5ed1..a90915a50ea623fbc003438024979bd5bcd9ed70 100644 (file)
@@ -122,7 +122,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