O'Reilly logo
  • Brandon Reeser thinks this is interesting:

The output adheres to the LIFO style of a queue. However, this is not a very efficient method. Popping the first element is not optimal because of the way a list is implemented. An efficient way to perform this operation is to use the deque data structure explained in the next section.


Cover of Python Data Science Cookbook