What's the neatest way of getting dictionary entries in a specified order?

Ethan Furman ethan at stoneleaf.us
Fri Mar 10 18:18:31 EST 2017


On 03/10/2017 03:06 PM, Steve D'Aprano wrote:
> On Fri, 10 Mar 2017 08:53 pm, Ethan Furman wrote:
>> On 03/10/2017 12:43 AM, Chris Green wrote:

>>> However how else can one describe an order which isn't 'sorted'? ...
>>> other than as the order one wants?
>>
>> I want the order to be the same as the order I enter them in.  ;)
>
>
> That's not the same thing at all.
>
> I added Fred to the address book in January. I added Sue to the address book
> in February. I added George to the address book in March. But I want them
> to show up in the order Sue, George, Fred.

The OP was talking about the field names, not the entire record.

--
~Ethan~



More information about the Python-list mailing list