On Jan 16, 2008 3:03 PM, Dennis Lee Bieber <[EMAIL PROTECTED]> wrote:
> On Wed, 16 Jan 2008 13:59:03 +0800, "J. Peng" <[EMAIL PROTECTED]>
> declaimed the following in comp.lang.python:
>
>
> > How to modify the array passed to the function? I tried something like this:
> >
> > >>> a
> > [1, 2, 3]
> > >>> def mytest(x):
> > ...   x=[4,5,6]
>
>         x is unqualified (in my terms), so you have just disconnected it
> from the original argument and connected it to [4,5,6]
>

Ok, thanks.
But there is a following question,when we say,

>>> x=[1,2,3]

we create a list.then we say,

>>> x=[4,5,6]

we create a new list and assign it to x for future use.
How to destroy the before list [1,2,3]? does python destroy it automatically?
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to