In article <roy-0ec6f2.08091107092...@news.panix.com>, Roy Smith <r...@panix.com> wrote: > >Imagine that you're looking at some code which was written years ago, by >people who are no longer around to answer questions. In one place, you >see: > >for i in range(n): > blah > >and in another, you see: > >for j in xrange(n): > blah > >If you are truly a Python expert, you'll say to yourself, "range and >xrange are synonyms", and move on to other things. If, however, you're >not really an expert, you'll look at this and say, "Hmmm, in one place >they used range(), and in another they used xrange(). Clearly, there's >some reason for the difference, I need to figure out what it is, because >that's probably key to my understanding why this code isn't working". >So, you spend the next two hours pouring over reference manuals trying >to understand the subtle difference, until your friend comes over and >says, "You dolt, you just wasted half the afternoon. They're the same >thing. Move on, this is not the bug you're looking for".
...and if you're a Python guru, you might spend a little bit of time trying to figure out if the range() is causing the problem due to allocating a large chunk of memory.... -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "...if I were on life-support, I'd rather have it run by a Gameboy than a Windows box." --Cliff Wells -- http://mail.python.org/mailman/listinfo/python-list