On 02/12/2013 02:56 PM, Guido van Rossum wrote:
Frankly, enums are not that useful in small programs. For large programs or libraries, and especially for public APIs, the extra cost of defining the enum shouldn't count against them.
I have to disagree. I'm working on converting data from program A to program B and it involves many small scripts for the different input files. Each script ranges from 10 - 50 lines long, and enums -- which I use to access the various columns from the incoming file -- are incredibly useful.
Let's just import Barry's enums into the stdlib.
Weren't you at one point unhappy that Barry's enums were not int based? At any rate, non-int based enums would absolutely *not* work for me. for line in open('somefile.txt'): fields = line.split('\t') name = NameCase(fields[int(NAME)]) business = BsnsCase(fields[int(COMPANY)]) street = AddrCase(fields[int(ADDRESS)]) etc., etc., and stab me now with my keyboard! ;) -- ~Ethan~