Kaydet (Commit) 446a4f23 authored tarafından Raymond Hettinger's avatar Raymond Hettinger

Minor factoring.

üst 238018c5
...@@ -122,7 +122,7 @@ class OrderedDict(dict, MutableMapping): ...@@ -122,7 +122,7 @@ class OrderedDict(dict, MutableMapping):
''' '''
if not self: if not self:
raise KeyError('dictionary is empty') 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) value = self.pop(key)
return key, value return key, value
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment