Issue 16553: named kwd form of OrderedDict ctor yield random key 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 Issue16553 ➜ 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-11-25 20:38 by yop , last changed 2022-04-11 14:57 by admin . This issue is now closed . Messages (2) msg176387 - (view) Author: yop (yop) Date: 2012-11-25 20:38 tested on 2.7.3 with -R or stock 3.3, the following: OrderedDict(foo=0,bar=0).keys() is nondeterminstic as a result of hash randomization. probably since **kwds creates a dict. what is the proper idiom for constructing an ordered-key dictionary other then (ugly, verbose) piecemeal insertion? msg176388 - (view) Author: Benjamin Peterson (benjamin.peterson) * Date: 2012-11-25 20:41 It's random anyway, since keyword arguments have no order.
You can use a tuple. History Date User Action Args 2022-04-11 14:57:38 admin set github: 60757 2012-11-25 20:41:27 benjamin.peterson set status: open -> closed resolution: not a bug 2012-11-25 20:41:19 benjamin.peterson set messages: + msg176388 2012-11-25 20:38:07 yop create Supported by The Python Software Foundation , Powered by Roundup Copyright © 1990-2022, Python Software Foundation Legal Statements