Re: Yet another question about class property.

2009-05-20 Thread Dave Angel
Jim Qiu wrote: Thanks for you patience, Dave. Obviously i have not got used to the python philosophy. Following you guide, i implemented the following code, and you are absolutely right. #!/usr/bin/python #coding:utf-8 class Parent(object): def __init__(self): pass def displayAttrOfSubClass(

Re: Yet another question about class property.

2009-05-20 Thread Jim Qiu
Thanks for you patience, Dave. Obviously i have not got used to the python philosophy. Following you guide, i implemented the following code, and you are absolutely right. #!/usr/bin/python #coding:utf-8 class Parent(object): def __init__(self): pass def displayAttrOfSubClass(self): print self

Re: Yet another question about class property.

2009-05-20 Thread Dave Angel
Jim Qiu wrote: Hi everyone, Following is the code i am reading, i don't see anywhere the declaration of Message.root object, Where is it from? #bots-modules import bots.botslib as botslib import bots.node as node from bots.botsconfig import * class Message(object): ''' abstract class; rep

Re: Yet another question about class property.

2009-05-20 Thread Mike Kazantsev
Jim Qiu wrote: > Hi everyone, > > Following is the code i am reading, i don't see anywhere the declaration of > Message.root object, > Where is it from? ... Prehaps it gets assigned by the parent itself? Like this: def spawn_child(self): child = Message() child.root = self -- Mike Ka

Yet another question about class property.

2009-05-20 Thread Jim Qiu
Hi everyone, Following is the code i am reading, i don't see anywhere the declaration of Message.root object, Where is it from? #bots-modules import bots.botslib as botslib import bots.node as node from bots.botsconfig import * class Message(object): ''' abstract class; represents a edi mes