Re: Python Array

2016-03-30 Thread Cameron Simpson
On 30Mar2016 22:53, Stephen Hansen wrote: On Wed, Mar 30, 2016, at 10:34 PM, tdspe...@gmail.com wrote: as you can see the option element was added third but is the first one displayed. Is this just standard - I am using Python 3.5 The order of items in dictionaries is based on the hash value

Re: Python Array

2016-03-30 Thread Jussi Piitulainen
Stephen Hansen writes: > On Wed, Mar 30, 2016, at 10:34 PM, tdspe...@gmail.com wrote: >> as you can see the option element was added third but is the first one >> displayed. >> >> Is this just standard - I am using Python 3.5 > > The order of items in dictionaries is based on the hash value -- wh

Re: Python Array

2016-03-30 Thread Mark Lawrence via Python-list
On 31/03/2016 06:34, tdspe...@gmail.com wrote: I am creating the following aData = [] This is a Python list, not an array as the subject gives. # get my data from database for row in rows: aData.append({row["tierid"]:"name":row["tiername"],"description":row["tierdesc"],"option":row["tie

Re: Python Array

2016-03-30 Thread Stephen Hansen
On Wed, Mar 30, 2016, at 10:34 PM, tdspe...@gmail.com wrote: > as you can see the option element was added third but is the first one > displayed. > > Is this just standard - I am using Python 3.5 The order of items in dictionaries is based on the hash value -- which while stable, should be consi

Re: Python Array

2016-03-30 Thread Chris Angelico
On Thu, Mar 31, 2016 at 4:34 PM, wrote: > as you can see the option element was added third but is the first one > displayed. > Dictionaries don't have any order to them, so yes, this is something you'll have to accept. ChrisA -- https://mail.python.org/mailman/listinfo/python-list