0

I need to implement a buffer / queue like storage with a given capacity of n that stores n objects and deletes the oldest one if it is full and stores the newest. I bet there must be a defined standard library for this?

Thanks, EL

1 Answer 1

3

I think you're looking for the collections module. More specifically the deque data structure, which allows you to set a maximum length and automatically drops elements from the end.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.