On 4 February 2013 10:53, João Bernardo <jbvsmo@gmail.com> wrote:
Hi, about this enum/const thing, The use case I like more is a class where you know all the
instances and not just a sequence of names.
Particularly It would be nice to have custom attributes and methods besides the value and the name.

I have my own implementation with a basic api somewhat borrowed from flufl.enum (plus a lot of other stuff),
but with this kind of support: https://github.com/jbvsmo/makeobj

I considered it, and in fact you could almost do it with my implementation by using a custom subclass of EnumValue (except trying it has just exposed a design flaw with the whole _EnumProxy bit). Works if you create the enum in the same module as EnumValues, fails otherwise. Going to have to have a rethink.

Tim Delaney