python-diskcache icon indicating copy to clipboard operation
python-diskcache copied to clipboard

collections.deque maxlen equivalent

Open wiryonolau opened this issue 4 years ago • 1 comments

Hi while Deque have same function as collections.deque but it missing the maxlen function.

Is there a solution to remove the most right when push from left and maxlen is reach, and vice versa using Deque.

Or I should use Cache instead and pass collections.deque ?

wiryonolau avatar Jan 28 '21 23:01 wiryonolau

That's correct, diskcache.Deque does not implement the "maxlen" parameter.

It's possible to use Deque.transact() to keep the length of the Deque in check.

grantjenks avatar Jan 29 '21 05:01 grantjenks

Released in v5.6.0

grantjenks avatar Apr 18 '23 05:04 grantjenks