[EMAIL PROTECTED] wrote:
> ex_ottoyuhr wrote:
> > class TreeCommand:
> > opcode = 0
> > children = []
> > def __init__(self, anOpcode) :
> > opcode = anOpcode
> >
> opcode and children in this case is more like "class" variable in C++.
> If you want "instance" variable, you nee
Devan L wrote:
> Well, for one, in your __init__ method, you never do anything with
> anOpcode. You simply assign the name 'opcode' to anOpcode. The reason
> why everything is the same is that you're accessing
> TreeCommand.children or Treecommand.opcode, which is shared by all
> instances unles
ex_ottoyuhr wrote:
> class TreeCommand:
> opcode = 0
> children = []
> def __init__(self, anOpcode) :
> opcode = anOpcode
>
opcode and children in this case is more like "class" variable in C++.
If you want "instance" variable, you need to do it as self.opcode,
self.children, i
ex_ottoyuhr wrote:
> To start with, I'm new at Python, so if this is something relatively
> ordinary or a symptom of thinking in C++, I apologize...
>
> Anyhow, I'm currently trying to write a means of generating
> genetic-programming functions in Python; the details would be a little
> much for a