MCPcopy Index your code
hub / github.com/python/cpython / put

Method put

Lib/queue.py:329–336  ·  view source on GitHub ↗

Put the item on the queue. The optional 'block' and 'timeout' arguments are ignored, as this method never blocks. They are provided for compatibility with the Queue class.

(self, item, block=True, timeout=None)

Source from the content-addressed store, hash-verified

327 self._count = threading.Semaphore(0)
328
329 def put(self, item, block=True, timeout=None):
330 '''Put the item on the queue.
331
332 The optional 'block' and 'timeout' arguments are ignored, as this method
333 never blocks. They are provided for compatibility with the Queue class.
334 '''
335 self._queue.append(item)
336 self._count.release()
337
338 def get(self, block=True, timeout=None):
339 '''Remove and return an item from the queue.

Callers 1

put_nowaitMethod · 0.95

Calls 2

appendMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected