A Q. on pop().

spencer infotechsys at pivot.net
Fri Mar 18 17:21:09 CET 2005

The code.

def buildStackMajor():
    for node in dirStackMinor:
        #print 's is the node...', node
        print 'POP the stack...', len(dirStackMinor)
        print 'after pop...', dirStackMinor

When I start the "for" loop I have 11 members in 
the stack- a list. The pop() is poping member
from the back, as though it's deal with a LIFO
stack instead of LIFO. I never get pass a length
of 5.
first Q.. Why is pop() starting from the back
          back of the stack?
second Q.. Why can't I never empty the stack?

More information about the Python-list mailing list