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

Popular posts from this blog

Spring Elasticsearch Operations

Network Error and Timeout on Authorize.net JS

Object oriented programming concepts (OOPs)