On Mon, Feb 9, 2009 at 7:06 PM, Senthil Kumaran <orsent...@gmail.com> wrote: >>>> timeit.Timer("for i in range(1000): >>>> l.append(i)","l=[]").timeit(number=1000) > 0.21927285194396973 > > You see that is slow and the reason is l.append being called again > and again. lets eliminate it.
Sorry, it is slow because the append method "Look-up" on the list object is done again and again. Read further. Rest of my explanation is okay. -- Senthil _______________________________________________ BangPypers mailing list BangPypers@python.org http://mail.python.org/mailman/listinfo/bangpypers