There is a nice class Enum
from enum
, but it only works for strings. I'm currently using:
for index in range(len(objects)):
# do something with index and objects[index]
I guess it's not the optimal solution due to the premature use of len
. How is it possible to do it more efficiently?