[clug-progsig] python lists
poprzen at shaw.ca
Sun Sep 12 19:52:35 PDT 2004
On September 12, 2004 06:46 pm, Shawn wrote:
> I don't know python, but I'll take a crack at this...
> Obviously, saying "list2 = list1" is setting list2 to a reference of list1.
> You want to set the VALUE of list2. In PHP you can achieve this via the &
> character (I think) - something like "list2 = &list1". I'm sure there
> should be something similar in Python. Search online or help for a
> "address of" or "value of" operator.
> If you can't find something like that in Python, the only other way I can
> think of is to loop through the elements in list1 and add them to list2,
> but this would be a performance hit with large lists.
> Hope this helps.
I'm gonna check what PHP says about it. Problems are always oportunity to
Man is a rational animal who always loses his temper when he is called
upon to act in accordance with the dictates of reason.
-- Oscar Wilde
More information about the clug-progsig