
July 28, 2011
6:10 a.m.
On Thursday 28.07.2011 00:24:09 Nick Coghlan wrote:
1. I find the "enum" concept too limiting. NamedValue (as a mixin class) is a better building block since it separates the naming aspect from the "group of values" aspect implied by enum. It would be nice, for example, if we could do things like "tau = NamedFloat('tau', 2*math.pi)" where NamedFloat is essentially just "class NamedFloat(NamedValue, float): pass" (this could, of course, be hidden behind a factory function that used type(value) and a cache to dynamically create appropriate subclasses)
+1 Very nice idea!