MCPcopy Create free account
hub / github.com/ActiveState/code / pop

Method pop

recipes/Python/259179_deque_collection_class/recipe-259179.py:22–28  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

20 self.pop()
21
22 def pop(self):
23 if self.left == self.right:
24 raise IndexError('cannot pop from empty deque')
25 self.right -= 1
26 elem = self.data[self.right]
27 del self.data[self.right]
28 return elem
29
30 def popleft(self):
31 if self.left == self.right:

Callers 7

appendleftMethod · 0.95
rotateMethod · 0.95
__delitem__Method · 0.95
popleftMethod · 0.95
_populateMethod · 0.45
_ansvMethod · 0.45
MoveDiscMethod · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected