PEP 285: Adding a bool type

Guido van Rossum guido at python.org
Mon Apr 8 12:47:20 EDT 2002


John Roth wrote:
> Unfortunately, I don't see a PEP on enums. Maybe I should
> dust off the rewrite of the set PEP I made that included them.

You could reuse some of the implementation techniques I used
for bool.  Then bool could later be retrofitted as an enum.
Like bool, I expect that the key benefit of enums is that
when you print them you'll get their name instead of their
value.  Currently I use string literals for that, but it's
not always optimal, and doesn't work for C APIs.

--Guido van Rossum (home page: http://www.python.org/~guido/)



More information about the Python-list mailing list