Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #72469 > unrolled thread

Re: can someone explain the concept of "strings (or whatever) being immutable"

Started byGary Herron <gary.herron@islandtraining.com>
First post2014-06-02 22:10 -0700
Last post2014-06-02 22:10 -0700
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: can someone explain the concept of "strings (or whatever) being immutable" Gary Herron <gary.herron@islandtraining.com> - 2014-06-02 22:10 -0700

#72469 — Re: can someone explain the concept of "strings (or whatever) being immutable"

FromGary Herron <gary.herron@islandtraining.com>
Date2014-06-02 22:10 -0700
SubjectRe: can someone explain the concept of "strings (or whatever) being immutable"
Message-ID<mailman.10591.1401772615.18130.python-list@python.org>

[Multipart message — attachments visible in raw view] — view raw

On 06/02/2014 09:39 PM, Deb Wyatt wrote:
> a_string = "This is a string"
> a_string is pointing to the above string
>
> now I change the value of a_string
> a_string = "This string is different"
> I understand that now a_string is pointing to a different string than 
> it was before, in a different location.
>
> my question is what happens to the original string??  Is it still in 
> memory somewhere, nameless?
> Thanks in advance,


Yes, possibly, for a short while it will be nameless in memory 
somewhere.  If nothing else is pointing to it, it will eventually be 
garbage collected.

Gary Herron





>
> ------------------------------------------------------------------------
> 3D Marine Aquarium Screensaver Preview 
> <http://www.inbox.com/marineaquarium>
> *Free 3D Marine Aquarium Screensaver*
> Watch dolphins, sharks & orcas on your desktop! Check it out at 
> www.inbox.com/marineaquarium <http://www.inbox.com/marineaquarium>
>
>

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web