Following along with python's deque here, I think it would be incredibly useful if you provided a max length parameter, to prevent a collection going over a certain size.
From python's docs:
If maxlen is not specified or is None, deques may grow to an arbitrary length. Otherwise, the deque is bounded to the specified maximum length. Once a bounded length deque is full, when new items are added, a corresponding number of items are discarded from the opposite end. Bounded length deques provide functionality similar to the tail filter in Unix. They are also useful for tracking transactions and other pools of data where only the most recent activity is of interest.
Following along with python's deque here, I think it would be incredibly useful if you provided a max length parameter, to prevent a collection going over a certain size.
From python's docs: