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

2011-04-19 Thread Steven D'Aprano
bod...@googlemail.com wrote: And presumably cleans up the leftover object with the value of 42 when it changes to point at the 43 object? In principle, yes, the garbage collector will destroy the no-longer used object 42 once nothing is pointing to it any more. But in practice, Python cache

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

2011-04-19 Thread Steven D'Aprano
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

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

2011-04-19 Thread Marc Tompkins
On Tue, Apr 19, 2011 at 2:37 PM, Joel Goldstick wrote: > > On Tue, Apr 19, 2011 at 3:32 PM, wrote: > >> And presumably cleans up the leftover object with the value of 42 when it >> changes to point at the 43 object? >> >> Or does it leave all changes in memory until the program exits? >> > > If a

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

2011-04-19 Thread Joel Goldstick
On Tue, Apr 19, 2011 at 3:32 PM, wrote: > And presumably cleans up the leftover object with the value of 42 when it > changes to point at the 43 object? > > Or does it leave all changes in memory until the program exits? > > Bodsda. > Sorry for top posting, my phone won't let me change it > Sent

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

2011-04-19 Thread bodsda
And presumably cleans up the leftover object with the value of 42 when it changes to point at the 43 object? Or does it leave all changes in memory until the program exits? Bodsda. Sorry for top posting, my phone won't let me change it Sent from my BlackBerry® wireless device -Original Me