24 May, 2021 08:54

https://betterprogramming.pub/stop-using-python-lists-everywhere-consider-using-deques-instead-74d37441be4e

Stop Using Python Lists Everywhere — Consider Using Deques Instead | by Yong Cui | May, 2021 | Better Programming
Lists for FIFO implementation. We use a list object (clients) to hold data.When a client enters the system, we append the client to the end of the waiting list. Whenever an associate becomes available, we remove the first client in the waiting list by calling pop(0).This method doesn’t only return the first item in the list but also removes it from the list.
betterprogramming.pub

Publié

dans

par

Étiquettes :