MCPcopy Index your code
hub / github.com/grantjenks/python-sortedcontainers / PriorityQueue

Class PriorityQueue

tests/benchmark_sortedlist.py:244–267  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

242 raise NotImplementedError
243
244class PriorityQueue(Mixed):
245 def run(self, value):
246 """
247 40% add
248 40% pop
249 10% discard
250 9% contains
251 1% iter (first 100 elements)
252 """
253 obj = self.obj
254 pos = self.rand.randrange(100)
255
256 if pos < 40:
257 obj.add(value)
258 elif pos < 80:
259 obj.pop()
260 elif pos < 90:
261 obj.discard(value)
262 elif pos < 99:
263 value in obj
264 else:
265 for idx, temp in enumerate(obj):
266 if idx > 100:
267 break
268
269for name, kind in kinds.items():
270 impls['priorityqueue'][name] = {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected