On Mar 8, 2:43 pm, malkarouri <[EMAIL PROTECTED]> wrote:
> Hi everyone,
>
> I have an algorithm in which I need to use a loop over a queue on
> which I push values within the loop, sort of:
>
> while not(q.empty()):
> x = q.get()
> #process x to get zero or more y's
> #for each y:
>
On Mar 8, 5:37 pm, malkarouri <[EMAIL PROTECTED]> wrote:
> On Mar 8, 6:24 pm, rockingred <[EMAIL PROTECTED]> wrote:
>
> > I think it's a bad practice to get into. Did you intend to do the
> > "process" step again over the added variables? If not I would set a
> > new variable, based on your awful
On Mar 8, 10:42 pm, Carl Banks <[EMAIL PROTECTED]> wrote:
> On Mar 8, 9:43 am, malkarouri <[EMAIL PROTECTED]> wrote:
>
> > Hi everyone,
>
> > I have an algorithm in which I need to use a loop over a queue on
> > which I push values within the loop, sort of:
>
> > while not(q.empty()):
> > x = q
On Mar 8, 9:43 am, malkarouri <[EMAIL PROTECTED]> wrote:
> Hi everyone,
>
> I have an algorithm in which I need to use a loop over a queue on
> which I push values within the loop, sort of:
>
> while not(q.empty()):
> x = q.get()
> #process x to get zero or more y's
> #for each y:
>
On Mar 8, 6:24 pm, rockingred <[EMAIL PROTECTED]> wrote:
> I think it's a bad practice to get into. Did you intend to do the
> "process" step again over the added variables? If not I would set a
> new variable, based on your awful naming convention, let's call it z.
> Then use z.append(y) within
On Mar 8, 4:44 pm, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote:
...
> Notice that the language specification *deliberately* does not
> distinguish between deletion of earlier and later items, but
> makes modification of the sequence undefined behavior to allow
> alternative implementations. E.g. an
> Notice that the language specification *deliberately* does not
> distinguish between deletion of earlier and later items, but
> makes modification of the sequence undefined behavior to allow
> alternative implementations. E.g. an implementation that would
> crash, erase your hard disk, or set you
On Mar 8, 9:43 am, malkarouri <[EMAIL PROTECTED]> wrote:
> Hi everyone,
>
> I have an algorithm in which I need to use a loop over a queue on
> which I push values within the loop, sort of:
>
> while not(q.empty()):
> x = q.get()
> #process x to get zero or more y's
> #for each y:
>
> Still, why avoid changing loop variable? Does python treat looping
> over a list differently from looping over an iterator, where it
> doesn't know if the iterator future changes while loop running?
Take a look at Objects/listobject.c:listiterobject. It contains
an it_index, which is the index i
On Mar 8, 3:52 pm, duncan smith <[EMAIL PROTECTED]> wrote:
> malkarouri wrote:
> > Hi everyone,
>
> > I have an algorithm in which I need to use a loop over a queue on
> > which I push values within the loop, sort of:
>
> > while not(q.empty()):
> > x = q.get()
> > #process x to get zero or
On Mar 8, 3:20 pm, Roel Schroeven <[EMAIL PROTECTED]>
wrote:
> malkarouri schreef:
>
>
>
> > Hi everyone,
>
> > I have an algorithm in which I need to use a loop over a queue on
> > which I push values within the loop, sort of:
>
> > while not(q.empty()):
> > x = q.get()
> > #process x to g
malkarouri wrote:
> Hi everyone,
>
> I have an algorithm in which I need to use a loop over a queue on
> which I push values within the loop, sort of:
>
> while not(q.empty()):
> x = q.get()
> #process x to get zero or more y's
> #for each y:
> q.put(y)
>
> The easiest thing I ca
malkarouri schreef:
> Hi everyone,
>
> I have an algorithm in which I need to use a loop over a queue on
> which I push values within the loop, sort of:
>
> while not(q.empty()):
> x = q.get()
> #process x to get zero or more y's
> #for each y:
> q.put(y)
>
> The easiest thing I
Hi everyone,
I have an algorithm in which I need to use a loop over a queue on
which I push values within the loop, sort of:
while not(q.empty()):
x = q.get()
#process x to get zero or more y's
#for each y:
q.put(y)
The easiest thing I can do is use a list as a queue and a normal
14 matches
Mail list logo