Speed-up for loops

Terry Reedy tjreedy at udel.edu
Tue Sep 7 20:19:02 EDT 2010


On 9/7/2010 6:00 AM, BartC wrote:

>> Why should it? But if you want it, you can do it:
>>
>> xrange = range
>>
>> There, that wasn't hard, was it?
>
> I think I just learned more about Python than from months of reading this
> group.
>
> So 'range' is just a class like any other. And that a class is something
> you
> can blithely copy from one variable to another.

There is no copying of the class object. A new name is associated with 
the object. Any object can be given any number of names (aliases) that 
refer to the one and same object.

-- 
Terry Jan Reedy




More information about the Python-list mailing list