Em 01-02-2012 04:55, Cameron Simpson escreveu:
> On 01Feb2012 03:34, Paulo da Silva <p_s_d_a_s_i_l_...@netcabo.pt> wrote:

> | BTW, iter seems faster than iterating thru mylist[1:]!
> 
> I would hope the difference can be attributed to the cost of copying
> mylist[1:]. 
I don't think so. I tried several times and the differences were almost
always consistent.

I put mylist1=mylist[1:] outside the time control. iter still seems a
little bit faster. Running both programs several times (10000000
elements list) I only got iter being slower once!

But, of course, most of the difference comes from the copy.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to