no pass-values calling?

Hrvoje Niksic hniksic at xemacs.org
Wed Jan 16 02:22:41 EST 2008


"J. Peng" <peng.kyo at gmail.com> writes:

> 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?

Yes, Python detects that the older list is no longer in use (if that
is indeed the case), and destroys it automatically.  If you're curious
how that works, take a look at
http://en.wikipedia.org/wiki/Reference_counting



More information about the Python-list mailing list