Hi, I have some problem with object reference
Say I have this code
a = b = c = None
slist = [a,b,c]
for i in range(len(slist)):
slist[i] = 5
print slist
print a,b,c
I got this
[5, 5, 5]
None None None
Question is how can I got all a,b,c variable to have value 5 also?
Thanks in advance
On Sat, Nov 14, 2009 at 3:25 PM, AON LAZIO aonla...@gmail.com wrote:
Hi, I have some problem with object reference
Say I have this code
a = b = c = None
slist = [a,b,c]
Values are stored in the list, not references to names. Modifying the
list does not change what values the names a, b, and
Chris Rebert c...@rebertia.com writes:
On Sat, Nov 14, 2009 at 3:25 PM, AON LAZIO aonla...@gmail.com wrote:
Hi, I have some problem with object reference
Say I have this code
a = b = c = None
slist = [a,b,c]
Values are stored in the list, not references to names. Modifying the
list
Chris Rebert wrote:
On Sat, Nov 14, 2009 at 3:25 PM, AON LAZIO aonla...@gmail.com wrote:
Hi, I have some problem with object reference
Say I have this code
a = b = c = None
slist = [a,b,c]
Values are stored in the list, not references to names.
That is not right either, or else newbies
On Sat, Nov 14, 2009 at 6:53 PM, Terry Reedy tjre...@udel.edu wrote:
Chris Rebert wrote:
On Sat, Nov 14, 2009 at 3:25 PM, AON LAZIO aonla...@gmail.com wrote:
Hi, I have some problem with object reference
Say I have this code
a = b = c = None
slist = [a,b,c]
Values are stored in the list,