Re: list/classmethod problems

2006-03-15 Thread Magnus Lycka
ahart wrote: > I thank you all for your help and suggestions. I wasn't aware that > default values were considered class (static) values. That seems a > little odd to me, but as long as I know that's the case, I'll be fine. It's all very simple and regular: Things in the class scope is shared betw

Re: list/classmethod problems

2006-03-14 Thread bruno at modulix
ahart wrote: > Diez, Scott, and Bruno, > > I thank you all for your help and suggestions. I wasn't aware that > default values were considered class (static) values. These are *not* 'default values'. Defining a name in the body of a class statement bind that name to the *class*. To bind a name to

Re: list/classmethod problems

2006-03-13 Thread ahart
Diez, Scott, and Bruno, I thank you all for your help and suggestions. I wasn't aware that default values were considered class (static) values. That seems a little odd to me, but as long as I know that's the case, I'll be fine. I initialized my list member in the __init__() method and all is wor

Re: list/classmethod problems

2006-03-13 Thread Bruno Desthuilliers
ahart a écrit : > I'm pretty new to python and am trying to write a fairly small > application to learn more about the language. I'm noticing some > unexpected behavior in using lists in some classes to hold child > objects. Here is some abbreviated code to help me explain. > > ###

Re: list/classmethod problems

2006-03-13 Thread Scott David Daniels
ahart wrote: > I'm pretty new to python and am trying to write a fairly small > application to learn more about the language. I'm noticing some > unexpected behavior in using lists in some classes to hold child > objects. Here is some abbreviated code to help me explain. > > When I run this script

Re: list/classmethod problems

2006-03-13 Thread Diez B. Roggisch
> > Apparently, the p1 instance somehow thinks that the i3 instance is in > its list. The i3 instance should instead be in the list for p2. By the > way, when I call the __str__() method of p2, I get the same results as > when I do it for p1. The list appears to be acting as if it were a > static