3 ms·Processing a long list efficiently in Python2 points by japhyr 13y agoakx 13y agoOr, you know, just use a `collections.deque`, which is designed for fast ("approximately O(1)") pops from either end of the list.