Thanks for the explanation, Alan > > Is there a good reason to want to do such a thing?
There is a reason, but maybe you won't consider it a good one... I was writing a small program to simulate the gravitational dynamics of a system of many planets, using scipy's odeint to solve the equations of motion. I defined a class, CelestialBody, that describes objects that represent planets in my simulation. These objects have three attributes: position, velocity and mass (the first two are 3D-vectors; as such, the number of attributes is actually 7). The many-body system is represented in the simulation by a list of CelestialBody objects. The dynamical state of the system is represented by a 6N (N being the number of planets) component array storing the components of the position and linear momentum of each body, and the integration procedures (odeint in this case) usually take this array as argument. So, in my simulation code I have a list of planets (objects of class CelestialBody) because it is a natural way of representing the systems I want to simulate, and another list (an numpy.array, actually) storing the positions and momenta of each planet, needed for the numerical processing of the simulation. But the positions and momenta are already present in the planet list, since the objects themselves store that information. Then, the second list, even if necessary, is a duplication of things that already are defined in the code. I don't like it. It'd be better (no duplication) if it was just a list of references to the values stored in the planet objects, I think. But I see your point. Thanks again, Jose Amoreira
_______________________________________________ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor