In Python, what is a `deque` and where is it defined?

Python Professional Hard

Python Professional — Hard

In Python, what is a `deque` and where is it defined?

Key points

  • `deque` is specifically defined in the `collections` module.
  • It is different from a priority queue in the `heapq` module.
  • Not to be confused with a circular buffer in the `array` module.

Ready to go further?

Related questions