On Tue, 13 May 2008 10:20:41 -0700, John Nagle wrote: > Matt Nordhoff wrote: > >> Well, you should use "xrange(10)" instead of "range(10)". > > CPython really is naive. That sort of thing should be a > compile-time optimization.
It's not naive, it can't know at compile time what object is bound to the name `xrange` at runtime. Ciao, Marc 'BlackJack' Rintsch -- http://mail.python.org/mailman/listinfo/python-list