mirror of
https://github.com/python/cpython.git
synced 2025-08-31 05:58:33 +00:00
Minor factoring.
This commit is contained in:
parent
238018c5c4
commit
446a4f2330
1 changed files with 1 additions and 1 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue