On Dec 11, 3:55 am, "Chris Mellon" <[EMAIL PROTECTED]> wrote:
[snip]
> No. What range does is create and return a list of integers. The
> iteration is a separate step, and is traditional list iteration. In
> longhand, for x in range(y): looks something like this:
>
> range = []
> #this loop happens in C and is super-fast for small values of y, it
> #gets much much slower when y gets out of the range of pre-allocated list 
> pools
> #and the small integer cache
> while y >= 0:
>   range.append(y)
>   y -= 1

When y is 3, the above appears to produce [3, 2, 1, 0] ...
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to