The built-in function len() (https://docs.python.org/3/library/functions.html#len) returns "the length (the number of items) of an object", but this is not implemented for queue.Queue (https://docs.python.org/3/library/queue.html).
Instead, queue.Queue has a qsize() method which returns the approximate size of a queue, when it clearly has a length; you can specify the maximum length of a Queue in the constructor. The similar collections.deque does work with len.
What are the reasons for not using the common len() for queue.Queue? Or: What would be the problems if qsize were instead named __len__ to enable the len() function?