Thanks, All, for the responses.
--
https://mail.python.org/mailman/listinfo/python-list
Larry Martell writes:
> A string and a list go into a bar. The string asks for a cup of
> coffee. The bartender says "We don't have coffee." The string asks for
> a cup of coffee. The bartender says "I told you we don't have coffee."
> The string asks for a cup of coffee. The bartender says to th
On Wed, Jun 13, 2018 at 10:56 PM, Sharan Basappa
wrote:
> The term mutable appears quite often in Python.
> Can anyone explain what is meant by mutable and immutable sequences.
A string and a list go into a bar. The string asks for a cup of
coffee. The bartender says "We don't have coffee." The s
didn't actually pass a copy of your list
(which could be huge), it passed a reference to a copy of your list.
--- Joseph Schachner
-Original Message-
From: Sharan Basappa
Sent: Wednesday, June 13, 2018 10:57 PM
To: python-list@python.org
Subject: mutable sequences
The term m
Sharan Basappa writes:
> For example, Python lists are mutable.
Yes, that's correct.
> BTW, is the below explanation correct (it is taken from a book I am
> reading)
>
> Python lists are mutable sequences. They are very similar to tuples,
> but they don't
n from a book I am reading)
>
> Python lists are mutable sequences. They are very similar to tuples, but they
> don't have the restrictions due to immutability.
>
> It says lists are mutable and then says they are immutable???
Lists are indeed mutable. Since they are mutable
below explanation correct (it is taken from a book I am reading)
Python lists are mutable sequences. They are very similar to tuples, but they
don't have the restrictions due to immutability.
It says lists are mutable and then says they are immutable???
You have come across a pet-peeve of
The term mutable appears quite often in Python.
Can anyone explain what is meant by mutable and immutable sequences.
For example, Python lists are mutable.
BTW, is the below explanation correct (it is taken from a book I am reading)
Python lists are mutable sequences. They are very similar to
e docs list and describe it as a method that only exists
> for
> MUTABLE sequences. Why only for mutables? The class of objects I would expect
> it
> to cover would be all ordered sequences, or, to phrase it a little more
> pointedly, anything that supports ordered INDEXing. My understandi
e docs list and describe it as a method that only exists
> for
> MUTABLE sequences. Why only for mutables? The class of objects I would expect
> it
> to cover would be all ordered sequences, or, to phrase it a little more
> pointedly, anything that supports ordered INDEXing. My understandi
.html); it wasn't there. A search
of the Library Reference's index seemed to confirm that the function did not
exist. A little later I realized it might be called "index" instead. Voila.
My point is that the docs list and describe it as a method that only exists for
MUTABLE sequenc
11 matches
Mail list logo