Simple object reference

2009-11-14 Thread AON LAZIO
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

Re: Simple object reference

2009-11-14 Thread Chris Rebert
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

Re: Simple object reference

2009-11-14 Thread Ben Finney
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

Re: Simple object reference

2009-11-14 Thread Terry Reedy
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

Re: Simple object reference

2009-11-14 Thread Chris Rebert
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,