In Python3, a metaclass can provide a "dict" type that behaves differently, e.g. an ordered
However, current Nuitka writes to that class dictionary only at the end, loosing order or
duplicate writes to that dictionary. It therefore fails to recognize this:
from enum import Enum
red = 1
green = 2
blue = 3
red = 4
The solution would be to have less efficient writing to the class dictionary, immediate and
each time. Also for reading, which the dictionary may also observe.
This is different from "exec" style locals dictionaries of Python2, with which classes in
Python2 and Python3 currently share code.
The really correct thing, will be a re-formulation of class bodies to writes to dictionary
prepared_dict["red"] = 1
prepared_dict["green"] = 2
prepared_dict["blue"] = 3
prepared_dict["red"] = 4
This re-forumation would then potentially be subject to optimizations.
Practically this issue is not yet fully relevant, and there is no optimization applied
to dictionary buildings, so this would drop speed a lot.
But for full Python3 support, this will be needed.