On 4 February 2013 10:53, Joćo Bernardo <jbvsmo@gmail.com> wrote:I have my own implementation with a basic api somewhat borrowed from flufl.enum (plus a lot of other stuff),Hi, about this enum/const thing, The use case I like more is a class where you know all theParticularly It would be nice to have custom attributes and methods besides the value and the name.
instances and not just a sequence of names.
but with this kind of support: https://github.com/jbvsmo/makeobjI 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.