mirror of https://github.com/python/cpython
Minor factoring.
This commit is contained in:
parent
a5cd6375c0
commit
1355a3dbf6
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue