[Tutor] Variables and constants [was Re: working with strings inpython3]

Steven D'Aprano steve at pearwood.info
Wed Apr 20 00:24:08 CEST 2011


Joel Goldstick wrote:

> If a value has no name bound to it, python figures that out and destroys it

Not quite... if there is no name, or any other reference, then the 
garbage collector will destroy it. But it doesn't have to be a name: 
anonymous objects can live inside lists, or dicts, or sets, or as values 
in functions, etc.



-- 
Steven





More information about the Tutor mailing list