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

Method __init__

recipes/Python/528878_Ordered_Set/recipe-528878.py:13–20  ·  view source on GitHub ↗
(self, iterable=(), allow_move=True)

Source from the content-addressed store, hash-verified

11 new next element. If you remove both, you get an error.
12 """
13 def __init__(self, iterable=(), allow_move=True):
14 self._map = {}
15 self._start = _SentinalNode()
16 self._end = _SentinalNode()
17 self._start.next = self._end
18 self._end.prev = self._start
19 self._allow_move = allow_move
20 self.extend(iterable)
21
22 def __contains__(self, element):
23 return element in self._map

Callers

nothing calls this directly

Calls 2

extendMethod · 0.95
_SentinalNodeClass · 0.85

Tested by

no test coverage detected