[BangPypers] Dictionary : An elementary question

Jeffrey Jose jeffjosejeff at gmail.com
Thu Aug 19 10:15:38 CEST 2010


On Thu, Aug 19, 2010 at 10:31 AM, Sahasranaman MS <sahasr at naman.ms> wrote:

>  On Thursday 19 August 2010 07:08 AM, Kenneth Gonsalves wrote:
>
>> On Wed, 2010-08-18 at 10:28 -0700, Anand Shankar wrote:
>>
>>> I have no clues. Any inputs??
>>>
>> sort order of dictionary keys is not guaranteed. Only a list will return
>> items in the same order as entered.
>>
> Python has an OrderedDict class from Python 3.1
> http://docs.python.org/dev/whatsnew/3.1.html#pep-372-ordered-dictionaries
> For older versions of python,  there are several other implementations that
> you could use.
>
>

When I was writing my reply I was thinking  - wasnt there something added
recently which is a dictionary and was ordered. Unfortunately I'm stuck on
2.5, so havent used this one.
Thanks for this.

> _______________________________________________
> BangPypers mailing list
> BangPypers at python.org
> http://mail.python.org/mailman/listinfo/bangpypers
>


More information about the BangPypers mailing list