fredrik at pythonware.com
Mon May 1 19:07:13 CEST 2006
David Isaac wrote:
> > it's considered bad style to use range if all you want is a
> > enumeration of indices, as it will actually create a list of the size you
> > specified. Use xrange in such cases.
> I'm pretty sure this distinction goes away in 2.5.
and for short sequences, it doesn't really matter much in the 2.X series.
it's definitely not "bad style" to use range instead of xrange for a ten to,
say, 1000 item loop.
(it's not always the most efficient thing to do, though, but that's
More information about the Python-list