Text of bugs.python.org › issue16276 as Styx crawled it on Nov 20, 2026. The page may have changed since. Only its words are kept, without pictures or layout.

Open the live page

Issue 16276: OrderedDict constructor do not keep items order - Python tracker

Python Home About News Documentation Downloads Community Foundation Developer's Guide Issue Tracker Issues Search Random Issue Summaries Issues with patch Easy issues Stats User Administration User List Committer List Help Tracker Documentation Tracker Development Report Tracker Problem Issue16276 ➜ This issue tracker has been migrated to GitHub , and is currently read-only . For more information, see the GitHub FAQs in the Python's Developer Guide.

Created on 2012-10-18 09:33 by ADechaume , last changed 2022-04-11 14:57 by admin . This issue is now closed . Messages (5) msg173247 - (view) Author: Antoine Dechaume (ADechaume) Date: 2012-10-18 09:33 Example: from collections import OrderedDict print OrderedDict(a=0,b=1,c=2) I get OrderedDict([('a', 0), ('c', 2), ('b', 1)]) I expected OrderedDict([('a', 0), ('b', 1), ('c', 2)]) msg173248 - (view) Author: Ezio Melotti (ezio.melotti) * Date: 2012-10-18 09:38 This is documented at http://docs.python.org/dev/library/collections#collections.OrderedDict : """The OrderedDict constructor and update() method both accept keyword arguments, but their order is lost because Python’s function call semantics pass-in keyword arguments using a regular unordered dictionary.""" msg173574 - (view) Author: Raymond Hettinger (rhettinger) * Date: 2012-10-23 01:39 Thanks Ezio. msg173581 - (view) Author: Antoine Dechaume (ADechaume) Date: 2012-10-23 06:20 I did read the docs before submitting, obviously my brain was not plugged in.

I am sorry for the noise. msg182239 - (view) Author: Eric Snow (eric.snow) * Date: 2013-02-16 20:48 FWIW, I'm working toward making **kwargs an OrderedDict. First step: issue #16991 History Date User Action Args 2022-04-11 14:57:37 admin set github: 60480 2013-02-16 20:48:42 eric.snow set nosy: + eric.snow messages: + msg182239 2012-10-23 06:20:37 ADechaume set messages: + msg173581 2012-10-23 01:39:10 rhettinger set nosy: + rhettinger messages: + msg173574 2012-10-18 09:38:36 ezio.melotti set status: open -> closed nosy: + ezio.melotti messages: + msg173248 resolution: not a bug stage: resolved 2012-10-18 09:33:33 ADechaume create Supported by The Python Software Foundation , Powered by Roundup Copyright © 1990-2022, Python Software Foundation Legal Statements