Re: Puzzled by behaviour of class with empty constructor

2008-01-25 Thread Tim Rau
On Jan 25, 5:54 pm, [EMAIL PROTECTED] wrote: > On Jan 25, 5:46 pm, Bjoern Schliessmann > > > [EMAIL PROTECTED]> wrote: > > [EMAIL PROTECTED] wrote: > > > print x.ends,y.ends,z.ends > > > # > > > Running the following code outputs: > > [(0, 2)] [(0, 2)] [(0, 2)] > > > > Can anyone

Re: Puzzled by behaviour of class with empty constructor

2008-01-25 Thread dbaston
On Jan 25, 5:46 pm, Bjoern Schliessmann wrote: > [EMAIL PROTECTED] wrote: > > print x.ends,y.ends,z.ends > > # > > Running the following code outputs: > [(0, 2)] [(0, 2)] [(0, 2)] > > > Can anyone explain this? > > Yes. You bound a single list to the name "ends" inside the class.

Re: Puzzled by behaviour of class with empty constructor

2008-01-25 Thread Diez B. Roggisch
[EMAIL PROTECTED] schrieb: > Hello, > > I have a class called 'Axis' that I use as a base class for several > types of axes that can be created by a grid generation program that I > have written: equally-spaced grids, logarithmic grids, etc. In any > case, if I use this base class by itself, I se

Re: Puzzled by behaviour of class with empty constructor

2008-01-25 Thread Tomek Paczkowski
[EMAIL PROTECTED] wrote: > Hello, > > I have a class called 'Axis' that I use as a base class for several > types of axes that can be created by a grid generation program that I > have written: equally-spaced grids, logarithmic grids, etc. In any > case, if I use this base class by itself, I see

Re: Puzzled by behaviour of class with empty constructor

2008-01-25 Thread Bjoern Schliessmann
[EMAIL PROTECTED] wrote: > print x.ends,y.ends,z.ends > # > Running the following code outputs: [(0, 2)] [(0, 2)] [(0, 2)] > > Can anyone explain this? Yes. You bound a single list to the name "ends" inside the class. This name is shared by all instances. If you want the instanc

Puzzled by behaviour of class with empty constructor

2008-01-25 Thread dbaston
Hello, I have a class called 'Axis' that I use as a base class for several types of axes that can be created by a grid generation program that I have written: equally-spaced grids, logarithmic grids, etc. In any case, if I use this base class by itself, I see some puzzling behaviour: