[Tutor] OrderedDict?

Alex Hall ahall at autodist.com
Thu Jun 2 07:15:53 EDT 2016


Thanks. I've never used that module before, and didn't realize it's not imported by default, which must be why my first tries failed. I've got it working now.
> On Jun 1, 2016, at 18:45, Alan Gauld via Tutor <tutor at python.org> wrote:
> 
> On 01/06/16 16:36, Alex Hall wrote:
> 
>> I'm trying to find the OrderedDict documentation. I found one page, but it
>> wasn't very clear on how to actually make an OrderedDict. Plus, an empty
>> constructor in Python's interpreter returns an error that the class doesn't
>> exist
> 
> It's in the collections module:
> 
>>>> import collections as coll
>>>> help(coll.OrderedDict)
> ...
>>>> od = coll.OrderedDict()
>>>> od
> OrderedDict()
>>>> 
> 
> 
> HTH
> -- 
> Alan G
> Author of the Learn to Program web site
> http://www.alan-g.me.uk/
> http://www.amazon.com/author/alan_gauld
> Follow my photo-blog on Flickr at:
> http://www.flickr.com/photos/alangauldphotos
> 
> 
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> https://mail.python.org/mailman/listinfo/tutor



More information about the Tutor mailing list