Steve R. Hastings wrote: >> in Python 2.X, range is defined to return a list. if you start >> returning something else, you'll break stuff. > > Perhaps I'm mistaken here, but I don't see how this optimization could > possibly break anything.
Because you assume that the only use-case of range() is within a for-loop. range() is a builtin function that can be used in any Python expression. For instance: RED, GREEN, BLUE, WHITE, BLACK = range(5) -- Giovanni Bajo -- http://mail.python.org/mailman/listinfo/python-list