On 12 February 2013 07:11, Tim Delaney <timothy.c.delaney@gmail.com> wrote:
And I've just realised that my enums will be broken when assigning a literal containing a name lookup e.g.

v = 1

class MyEnum(Enum):
    A, B
    other_attr = (v,)

other_attr will have an _EnumProxy instance. But I think I can do away with the _EnumProxy entirely now that I'm using sys._getframe(). Let me try something.

Too early in the morning. The above would avoid the whole _EnumProxy because 'v' would be successfully looked up in the global namespace. But I may still get rid of some instances of _EnumProxy.

Tim Delaney