From 446a4f23302ed3c33f32e6bd074b6752dc917b7a Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Wed, 8 Apr 2009 08:28:28 +0000 Subject: [PATCH] Minor factoring. --- Lib/collections.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Lib/collections.py b/Lib/collections.py index 3c1b78a3668..a90915a50ea 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