[sqlalchemy] Python 3.4 Enum type

2013-08-06 Thread Ian Kelly
Since Python 3.4 is adding support for enums to the standard library, I wrote a TypeDecorator for it: import sqlalchemy.types as types class PythonEnum(types.TypeDecorator): impl = types.Enum def __init__(self, enum_class, **kw): super().__init__(*(m.name for m in enum_class),

Re: [sqlalchemy] Python 3.4 Enum type

2013-08-06 Thread Michael Bayer
there's a lot of flavors of python enum and I recall the standard library one rubs me the wrong way a bit. I'd prefer for sqlalchemy.Enum to have some easy way to accommodate any Python-side enum using some kind of convention, obviously one that's compat with the std lib enum. On Aug 6,