From: Raymond Hettinger Date: Wed, 8 Apr 2009 08:28:28 +0000 (+0000) Subject: Minor factoring. X-Git-Tag: v3.1b1~340 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=446a4f23302ed3c33f32e6bd074b6752dc917b7a;p=python Minor factoring. --- diff --git a/Lib/collections.py b/Lib/collections.py index 3c1b78a366..a90915a50e 100644 --- a/Lib/collections.py +++ b/Lib/collections.py @@ -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