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


Groups > comp.lang.python > #72469

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

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 <gary.herron@islandtraining.com>
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 <gary.herron@islandtraining.com>
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 <CB9E0AA79B1.00000B26codemonkey@inbox.com>
In-Reply-To <CB9E0AA79B1.00000B26codemonkey@inbox.com>
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 <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.10591.1401772615.18130.python-list@python.org> (permalink)
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

Show key headers only | View raw


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

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

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

csiph-web