re best way to enumerate something in Python

Yermat loic at fejoz.net
Wed May 26 11:09:18 EDT 2004


David Stockwell wrote:
> I'm going to try using the range function.
> 
> as in:
> 
> ID_COL, ANIMAL_COL, HOUSING_COL = range(3)
> 
> This appears to assign assign those vars as 'constants' with values of 
> 0,1,2

You should get an eye on 
http://www.python.org/cgi-bin/moinmoin/EnumerationProgramming
It may give you some ideas...

-- 
Yermat




More information about the Python-list mailing list