New submission from Ethan Furman: With the landing of ordered class namespaces the build order for Enum needs to be redone to at least keep the user-specified pieces' relative order intact:
>>> from enum import Enum >>> class Color(Enum): ... red = 1 ... blue = 2 ... green = 3 ... def primary(self): ... return True ... >>> Color.__dict__.keys() dict_keys(['_generate_next_value_', '__module__', 'primary', '__doc__', '_member_names_', '_member_map_', '_member_type_', '_value2member_map_', 'red', 'blue', 'green', '__new__']) ---------- assignee: ethan.furman messages: 275374 nosy: barry, eli.bendersky, ethan.furman priority: normal severity: normal stage: test needed status: open title: Adjust class-build method of Enum so final ordered dict more closely resembles definition order type: behavior _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue28048> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com