View Single Post
Old Apr 18th, 2006, 3:33 PM   #2
Dietrich
Professional Programmer
 
Dietrich's Avatar
 
Join Date: Feb 2005
Posts: 434
Rep Power: 4 Dietrich is on a distinguished road
When you use
array2=array1
You are not making array2 a true copy of array1, you are making an alias, both array1 and array2 point to the same object. That means when you sort array1 then array2 is also sorted now!

To make a true copy of a simple list you can use
array2=array1[:]

There are a lot of strange things in your code, is this a direct translation from C?
__________________
I looked it up on the Intergnats!
Dietrich is offline   Reply With Quote