efficient idiomatic queue?

Aahz Maruch aahz at panix.com
Tue Jan 15 22:20:27 EST 2002


In article <eppstein-27FE15.16175514012002 at news.service.uci.edu>,
David Eppstein  <eppstein at ics.uci.edu> wrote:
>
>What is the idiomatic way in Python of implementing the following 
>operations on a list of elements:
> - return the element at the front of the list, without changing the list
> - remove the element from the front of the list
> - add a new element to the rear of the list

Just to be a jerk, why not use a dict with a couple of index variables?
-- 
                      --- Aahz  <*>  (Copyright 2002 by aahz at pobox.com)

Hugs and backrubs -- I break Rule 6                 http://www.rahul.net/aahz/
Androgynous poly kinky vanilla queer het Pythonista   

"There are times when effort is important and necessary, but this should
not be taken as any kind of moral imperative."  --jdecker



More information about the Python-list mailing list