[prev in list] [next in list] [prev in thread] [next in thread]
List: python-list
Subject: Re: collect data using threads
From: James Tanis <jtanis () pycoder ! org>
Date: 2005-06-14 19:23:10
Message-ID: Pine.BSO.4.61.0506141438450.5917 () loki ! pycoder ! org
[Download RAW message or body]
Previously, on Jun 14, Peter Hansen said:
# James Tanis wrote:
# > I may be wrong here, but shouldn't you just use a stack, or in other
# > words, use the list as a stack and just pop the data off the top. I
# > believe there is a method pop() already supplied for you.
#
# Just a note on terminology here. I believe the word "stack" generally
# refers to a LIFO (last-in first-out) structure, not what the OP needs
# which is a FIFO (first-in first-out).
What can I say? Lack of sleep.
#
# Assuming you would refer to the .append() operation as "putting data on
# the bottom", then to pop off the "top" you would use pop(0), not just
# pop().
Right, except I'm not writing his code for him, and I don't think he
expects me too. I was just referring to the existance of a pop()
function, perhaps I should have said pop([int]) to be clearer. Its use
would of course have to be tailored to his code depending on what he
requires.
#
# Normally though, I think one would refer to these as the head and tail
# (not top and bottom), and probably call the whole thing a queue, rather
# than a stack.
I agree, its been a while and I mixed the two names up, nothing more.
---
James Tanis
jtanis@pycoder.org
http://pycoder.org
--
http://mail.python.org/mailman/listinfo/python-list
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic