4 ms·
There is an OrderedDict class in the collections module of standard library. Enums store their members in a special __members__ attribute, which is such an Orde
by shoyer 13y ago
There is an OrderedDict class in the collections module of standard library. Enums store their members in a special __members__ attribute, which is such an OrderedDict. See this section of the PEP: http://www.python.org/dev/peps/pep-0435/#duplicating-enum-members-and-values http://www.python.org/dev/peps/pep-0435/#duplicating-enum-me...
- marmaduke 13y agoYou more or less ignored the contents of my comment w.r.t. execution model. I am well aware of OrderedDict, and I still do not understand how this behavior is possible unless Python 3 differs from 2 in the kind of dictionary used in code block executions.