Re: Just curious - I thought dict keys would maintain sequence

2013-03-18 Thread Steven D'Aprano
On Mon, 18 Mar 2013 18:31:33 +1100, Chris Angelico wrote: > On Mon, Mar 18, 2013 at 6:26 PM, Frank Millman > wrote: >> Hi all >> >> I know that you cannot rely on the order of keys in a dictionary, and I >> am not attempting to do so. >> >> Nevertheless, the following surprised me. A program crea

Re: Just curious - I thought dict keys would maintain sequence

2013-03-18 Thread Peter Otten
Chris Angelico wrote: > On Mon, Mar 18, 2013 at 6:26 PM, Frank Millman wrote: >> Hi all >> >> I know that you cannot rely on the order of keys in a dictionary, and I >> am not attempting to do so. >> >> Nevertheless, the following surprised me. A program creates a dictionary >> with a known set o

Re: Just curious - I thought dict keys would maintain sequence

2013-03-18 Thread Frank Millman
On 18/03/2013 09:31, Chris Angelico wrote: On Mon, Mar 18, 2013 at 6:26 PM, Frank Millman wrote: Hi all I know that you cannot rely on the order of keys in a dictionary, and I am not attempting to do so. Nevertheless, the following surprised me. A program creates a dictionary with a known set

Re: Just curious - I thought dict keys would maintain sequence

2013-03-18 Thread Chris Angelico
On Mon, Mar 18, 2013 at 6:26 PM, Frank Millman wrote: > Hi all > > I know that you cannot rely on the order of keys in a dictionary, and I am > not attempting to do so. > > Nevertheless, the following surprised me. A program creates a dictionary > with a known set of keys. I would have thought tha

Just curious - I thought dict keys would maintain sequence

2013-03-18 Thread Frank Millman
Hi all I know that you cannot rely on the order of keys in a dictionary, and I am not attempting to do so. Nevertheless, the following surprised me. A program creates a dictionary with a known set of keys. I would have thought that multiple runs of the program would return the keys in the sa