Looks good to me. I had meant to conditionally import queue or Queue, but forgot to add that before the commit. The main reason I chose to use the Queue because the class interface was better documented that deque. The deque name and initial docstring suggested to me that deque was a function and not a class. I see now that it's a class, so suitable for subclassing, and your example demonstrates a proper implementation. I much prefer your tweak. If that's the only change blocking acceptance of this PR, would you consider accepting the PR and then apply your change subsequently? I don't have git connectivity right now.