From 1355a3dbf6ef4c6d30ace8049cb0d7632387fbbc Mon Sep 17 00:00:00 2001 From: Raymond Hettinger Date: Wed, 8 Apr 2009 08:26:55 +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 7b207e3731a..4cffca00f5c 100644 --- a/Lib/collections.py +++ b/Lib/collections.py @@ -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