def __init__(self, maxsize=0):
        """
        The *maxsize* argument specifies the maximum queue size. If it is less
        than or equal to zero, the queue size is infinite.
        """
        self._maxsize = maxsize
        self._unfinished_tasks = 0
        # Use a list/heapq even for a FIFO instead of a deque() because of the
        # latter's high memory use (see comment in Lock). For most protocols
        # there will be one Queue per connection so a low memory footprint is
        # very important.
        self._heap = []
        self._size = 0
        self._counter = 0
        # Use a threading.Lock so that put_nowait() and get_nowait() don't need
        # to be a switchpoint. Also it is more efficient.
        self._lock = threading.Lock()
        self._notempty = Condition(self._lock)
        self._notfull = Condition(self._lock)
        self._alldone = Condition(self._lock)
def __init__ ( self , maxsize = 0 ) : self . _maxsize = maxsize self . _unfinished_tasks = 0 self . _heap = [ ] self . _size = 0 self . _counter = 0 self . _lock = threading . Lock ( ) self . _notempty = Condition ( self . _lock ) self . _notfull = Condition ( self . _lock ) self . _alldone = Condition ( self . _lock )
The *maxsize* argument specifies the maximum queue size. If it is less
        than or equal to zero, the queue size is infinite.