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: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=446a4f23302ed3c33f32e6bd074b6752dc917b7a;p=thirdparty%2FPython%2Fcpython.git Minor factoring. --- diff --git a/Lib/collections.py b/Lib/collections.py index 3c1b78a3668a..a90915a50ea6 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