[docs]classPriorityQueue(Queue[_T]):"""Queue where the lowest valued elements are retrieved first. Warning: Equally valued elements are not guaranteed to be retrieved in the order they arrived. """__slots__=('_queue',)
[docs]def__init__(self,*elements:_T,**kwargs:Any)->None:""" Args: elements: The elements to initialize the queue with. """self._queue=list(elements)heapify(self._queue)super().__init__(**kwargs)