On 2/12/07, Hazlett, Les <[EMAIL PROTECTED]> wrote: > If I pass a large list via a parameter, there will be two copies of the > list.
No. You pass a *reference* to the list, not the list itself. >>> a = [1,2,3,4] >>> b = a >>> b is a True >>> id(b), id(a) (1075562604, 1075562604) >>> b = [1,2,3,4] >>> b is a False >>> id(b), id(a) (1075562796, 1075562604) The "b = a" makes b reference a, that is a and b points to the same list. The "b = [1,2,3,4]" destroys the reference-ship with a, and creates a new list instead. The same goes for "b = a[:]", which is a copy of all the elements in a. -- - Rikard. _______________________________________________ Tutor maillist - Tutor@python.org http://mail.python.org/mailman/listinfo/tutor