Re: mutable sequences

2018-06-14 Thread Sharan Basappa
Thanks, All, for the responses. -- https://mail.python.org/mailman/listinfo/python-list

Re: mutable sequences

2018-06-14 Thread Ben Finney
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

Re: mutable sequences

2018-06-14 Thread Larry Martell
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

RE: mutable sequences

2018-06-14 Thread Schachner, Joseph
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

Re: mutable sequences

2018-06-13 Thread Ben Finney
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

Re: mutable sequences

2018-06-13 Thread Chris Angelico
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

Re: mutable sequences

2018-06-13 Thread Jim Lee
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

mutable sequences

2018-06-13 Thread Sharan Basappa
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

Re: "index" method only for mutable sequences??

2007-04-05 Thread James Stroud
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

Re: "index" method only for mutable sequences??

2007-04-05 Thread 7stud
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

"index" method only for mutable sequences??

2007-04-05 Thread C.L.
.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