MCPcopy Create free account
hub / github.com/clips/pattern / popitem

Method popitem

pattern/web/json/ordered_dict.py:63–73  ·  view source on GitHub ↗
(self, last=True)

Source from the content-addressed store, hash-verified

61 curr = curr[1]
62
63 def popitem(self, last=True):
64 if not self:
65 raise KeyError('dictionary is empty')
66 # Modified from original to support Python 2.4, see
67 # http://code.google.com/p/simplejson/issues/detail?id=53
68 if last:
69 key = reversed(self).next()
70 else:
71 key = iter(self).next()
72 value = self.pop(key)
73 return key, value
74
75 def __reduce__(self):
76 items = [[k, self[k]] for k in self]

Callers

nothing calls this directly

Calls 2

nextMethod · 0.45
popMethod · 0.45

Tested by

no test coverage detected