Re: Grabbing previous iteration in a dict

2008-05-09 Thread dannywebster
On May 9, 4:09 pm, Paul Hankin <[EMAIL PROTECTED]> wrote: > On May 9, 10:10 am, [EMAIL PROTECTED] wrote: > > > Hello all, > > > I have a dictionary of which i'm itervalues'ing through, and i'll be > > performing some logic on a particular iteration when a condition is > > met with trusty .startswit

Re: Grabbing previous iteration in a dict

2008-05-09 Thread Paul Hankin
On May 9, 10:10 am, [EMAIL PROTECTED] wrote: > Hello all, > > I have a dictionary of which i'm itervalues'ing through, and i'll be > performing some logic on a particular iteration when a condition is > met with trusty .startswith('foo').  I need to grab the previous > iteration if this condition i

Re: Grabbing previous iteration in a dict

2008-05-09 Thread Yves Dorfsman
[EMAIL PROTECTED] wrote: You cannot rely on the elements of a dictionary being in any particular order (dicts are internally hash tables), so the above is almost certainly ont what you want. Hi - thanks for your reply. How about if I made the dict into a list (of which I have done). How woul

Re: Grabbing previous iteration in a dict

2008-05-09 Thread Hyuga
On May 9, 5:10 am, [EMAIL PROTECTED] wrote: > I have a dictionary of which i'm itervalues'ing through, and i'll be > performing some logic on a particular iteration when a condition is > met with trusty .startswith('foo'). I need to grab the previous > iteration if this condition is met. I can do

Re: Grabbing previous iteration in a dict

2008-05-09 Thread Gary Herron
[EMAIL PROTECTED] wrote: On May 9, 10:48 am, Paul Rubin wrote: [EMAIL PROTECTED] writes: I have a dictionary of which i'm itervalues'ing through, and i'll be performing some logic on a particular iteration when a condition is met with trusty .startswith('foo')

Re: Grabbing previous iteration in a dict

2008-05-09 Thread dannywebster
On May 9, 10:48 am, Paul Rubin wrote: > [EMAIL PROTECTED] writes: > > I have a dictionary of which i'm itervalues'ing through, and i'll be > > performing some logic on a particular iteration when a condition is > > met with trusty .startswith('foo'). I need to grab the p

Re: Grabbing previous iteration in a dict

2008-05-09 Thread Paul Rubin
[EMAIL PROTECTED] writes: > I have a dictionary of which i'm itervalues'ing through, and i'll be > performing some logic on a particular iteration when a condition is > met with trusty .startswith('foo'). I need to grab the previous > iteration if this condition is met. I can do something with an