Queue.empty()
Queue.empty() is a Python method in the Queue Module category. Returns True if the queue is empty. The syntax is Queue.empty(). Returns: Boolean. A typical example: if not q.empty(): item = q.get(). A close sibling is queue.Queue(), which creates a FIFO (First-In-First-Out) thread-safe queue. A close sibling is queue.LifoQueue(), which creates a LIFO (Last-In-First-Out) thread-safe queue (stack). A close sibling is queue.PriorityQueue(), which creates a thread-safe priority queue (lowest value is retrieved first). A close sibling is Queue.put(), which puts an item into the queue. Blocks if full until space is available. More about this category: Thread-safe queues — Queue, LifoQueue, PriorityQueue, SimpleQueue. Related Queue Module entries: queue.Queue(), queue.LifoQueue(), queue.PriorityQueue(), Queue.put(), Queue.get(), Queue.task_done(). This page is part of the free Python Reference documentation covering 978+ functions, methods, and modules with examples and parameter details. You can try Queue.empty() immediately in the Python playground, look up unfamiliar terms in the glossary, or return to the Python Reference homepage.