Re: Problem with class variables

2007-03-29 Thread Thomas Krüger
Dag schrieb: > I have a problem which is probaly very simple to solve, but I can't > find a nice solution. > I have the following code > > class Test: > def __init__(self): > self.a=[1,2,3,4] > self.b=self.a > def swap(self): > self.a[0],self.a[3]=self.a[3],self.a[

Re: Problem with class variables

2007-03-29 Thread kyosohma
On Mar 29, 8:43 am, Marc 'BlackJack' Rintsch <[EMAIL PROTECTED]> wrote: > In <[EMAIL PROTECTED]>, Dag wrote: > > I have a problem which is probaly very simple to solve, but I can't > > find a nice solution. > > I have the following code > > > class Test: > > def __init__(self): > > self

Re: Problem with class variables

2007-03-29 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, Dag wrote: > I have a problem which is probaly very simple to solve, but I can't > find a nice solution. > I have the following code > > class Test: > def __init__(self): > self.a=[1,2,3,4] > self.b=self.a self.b = list(self.a) BTW this is a

Problem with class variables

2007-03-29 Thread Dag
I have a problem which is probaly very simple to solve, but I can't find a nice solution. I have the following code class Test: def __init__(self): self.a=[1,2,3,4] self.b=self.a def swap(self): self.a[0],self.a[3]=self.a[3],self.a[0] def prnt(self): pr