Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed3a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.014 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; '"this': 0.03; 'string': 0.09; 'received:67.192': 0.09; 'received:67.192.241': 0.09; 'received:dfw.emailsrvr.com': 0.09; 'aquarium': 0.16; 'garbage': 0.16; 'possibly,': 0.16; 'somewhere.': 0.16; 'subject: \n ': 0.16; 'url:my': 0.16; 'wrote:': 0.18; 'memory': 0.22; 'header:User- Agent:1': 0.23; 'received:emailsrvr.com': 0.24; 'question': 0.24; 'received:(smtp server)': 0.26; 'header:In-Reply-To:1': 0.27; 'subject:) ': 0.29; 'gary': 0.31; 'subject:the': 0.34; 'subject: (': 0.35; 'thanks': 0.36; 'to:addr:python-list': 0.38; 'pm,': 0.38; 'short': 0.38; 'subject:can': 0.39; 'to:addr:python.org': 0.39; 'eventually': 0.60; 'subject:"': 0.60; 'free': 0.61; 'different': 0.65; 'url:img': 0.74; 'url:jpg': 0.83; 'subject:being': 0.84 X-Virus-Scanned: OK Date: Mon, 02 Jun 2014 22:10:06 -0700 From: Gary Herron User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 MIME-Version: 1.0 To: python-list@python.org Subject: Re: can someone explain the concept of "strings (or whatever) being immutable" References: In-Reply-To: Content-Type: multipart/alternative; boundary="------------060604050904020000000900" X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 113 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1401772615 news.xs4all.nl 2922 [2001:888:2000:d::a6]:58938 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:72469 This is a multi-part message in MIME format. --------------060604050904020000000900 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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 > > *Free 3D Marine Aquarium Screensaver* > Watch dolphins, sharks & orcas on your desktop! Check it out at > www.inbox.com/marineaquarium > > --------------060604050904020000000900 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit
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
Free 3D Marine Aquarium Screensaver
Watch dolphins, sharks & orcas on your desktop! Check it out at www.inbox.com/marineaquarium



--------------060604050904020000000900--