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


Groups > comp.lang.python > #72466

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

Date 2014-06-02 21:06 -0800
From Deb Wyatt <codemonkey@inbox.com>
Subject Re: can someone explain the concept of "strings (or whatever) being immutable"
References <cb9e0aa79b1.00000b26codemonkey@inbox.com>
Newsgroups comp.lang.python
Message-ID <mailman.10589.1401772000.18130.python-list@python.org> (permalink)

Show all headers | View raw



> -----Original Message-----
> From: ben@benfinney.id.au
> Sent: Tue, 03 Jun 2014 14:54:01 +1000
> To: python-list@python.org
> Subject: Re: can someone explain the concept of "strings (or whatever)
> being immutable"
> 
> Deb Wyatt <codemonkey@inbox.com> writes:
> 
>> [no text]
> 
> Deb, can you expand a bit – and write the question in the body of your
> message? It's not clear what you want explained.
> 
> --
>  \          “I hope if dogs ever take over the world, and they chose a |
>   `\    king, they don't just go by size, because I bet there are some |
> _o__)                   Chihuahuas with some good ideas.” —Jack Handey |
> Ben Finney
> 
> --
> https://mail.python.org/mailman/listinfo/python-list
that's strange that you see no text.  The body of my email was as follows:

"""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?
"""
That was just the first question.  What does immutable really mean if you can add items to a list? and concatenate strings?  I don't understand enough to even ask a comprehensible question, I guess.


Thanks in advance,
Deb in WA, USA

____________________________________________________________
FREE 3D EARTH SCREENSAVER - Watch the Earth right on your desktop!
Check it out at http://www.inbox.com/earth

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


Thread

Re: can someone explain the concept of "strings (or whatever) being immutable" Deb Wyatt <codemonkey@inbox.com> - 2014-06-02 21:06 -0800
  Re: can someone explain the concept of "strings (or whatever) being immutable" Steven D'Aprano <steve@pearwood.info> - 2014-06-03 07:46 +0000

csiph-web