Problem with assigning variables of type List
see at below
Tue Aug 20 10:33:26 CEST 2002
On Tue, 20 Aug 2002 09:27:02 +0200, Max M wrote:
> Paul Foley wrote:
>> On 19 Aug 2002 14:48:34 -0700, Abhishek Roy wrote:
>>> Thank you very much. I had not realized that lists are passed by
>>> reference by default,
>> Good. Because they're not.
> Please elaborate with an example. A statement like that dosn't add much
> to the discussion.
> But I don't think we have the same definition of "by reference" and "by
> l1 = l2 = [1,2]
> print l2
>>>> [1, 2, 3]
> That is "by reference" in my book.
>>> def reftest(x):
... x = 
>>> y = [1,2,3]
[1, 2, 3]
if it were passed by reference, you'd see  on the last line.
Just because we Lisp programmers are better than everyone else is no
excuse for us to be arrogant. -- Erann Gat
(concatenate 'string "Paul Foley " "<mycroft" '(#\@) "actrix.gen.nz>"))
More information about the Python-list