Remove first 50 items in a queue
I have a very large list, and I'd like to iteratively remove the first 50 elements without copying it (as for example something like list[50:]).
My initial thought was by doing:
[list.pop(0) for i in range(50)]
What would be the most performant way to do this?
from Recent Questions - Stack Overflow https://ift.tt/3sirdiT
https://ift.tt/eA8V8J
Comments
Post a Comment