no shift/unshift?

Michael P. Soulier msoulier at storm.ca._nospam
Fri Feb 21 15:18:03 EST 2003


    Hello,

    I was wondering, is there no built-in way to pull values off and on to a
list in python? append and pop are find if you are working with the right
side, but if you need to work with both, having something like shift and
unshift from perl would be nice. 
    If I just need to simulate a stack, I'll reverse the list if need be, but
sometimes I want to manipulate both sides. 

    For consistency, it'd be nice to see append called push, too. append and
pop just sounds wrong when thinking about a stack. :)

    Thanks for any advice,
    Mike

-- 
Michael P. Soulier <msoulier at digitaltorque.ca>, GnuPG pub key: 5BC8BE08
"...the word HACK is used as a verb to indicate a massive amount
of nerd-like effort."  -Harley Hahn, A Student's Guide to Unix
HTML Email Considered Harmful: http://expita.com/nomime.html




More information about the Python-list mailing list