Re: class closure question

2008-01-17 Thread Peter Otten
Steven W. Orr wrote: > I want to indirectly change the value of a variable. > > #! /usr/bin/python > foo = [44] > bar = foo > bar[0] = 55 > print 'bar = ', bar > print 'foo = ', foo > > This works fine. > > bar = [55] > foo = [55] > > But I want to do the same with a class value. > > #! /us

Re: class closure question

2008-01-17 Thread Bruno Desthuilliers
Steven W. Orr a écrit : > I want to indirectly change the value of a variable. > Are you sure this is the correct formulation of your problem ? > #! /usr/bin/python > foo = [44] > bar = foo > bar[0] = 55 > print 'bar = ', bar > print 'foo = ', foo > > This works fine. > > bar = [55] > foo =

class closure question

2008-01-17 Thread Steven W. Orr
I want to indirectly change the value of a variable. #! /usr/bin/python foo = [44] bar = foo bar[0] = 55 print 'bar = ', bar print 'foo = ', foo This works fine. bar = [55] foo = [55] But I want to do the same with a class value. #! /usr/bin/python S = None dd = { 'class': [S] } class C1(obj