[Python-ideas] PEP for enum library type?
Antoine Pitrou
solipsis at pitrou.net
Wed Feb 13 20:27:31 CET 2013
On Wed, 13 Feb 2013 13:05:17 -0500
Barry Warsaw <barry at python.org> wrote:
> On Feb 13, 2013, at 12:59 AM, Georg Brandl wrote:
>
> >>> >>> from flufl.enum import make
> >>> >>> make('Colors', 'RED GREEN BLUE'.split())
> >>> <Colors {RED: 1, GREEN: 2, BLUE: 3}>
>
> >And like namedtuple, it's ugly as hell :)
>
> Suggestions for a better repr are welcome. ;)
It's not about the repr, it's about the make(...) call.
Regards
Antoine.
More information about the Python-ideas
mailing list