Re: Cyclic class definations

2006-07-18 Thread John Henry
Thanks for the note, Nick. I ended up with cycles as a historical reason. Some code that were written long time ago did not anticipate that part of it will get sub-classed. Thanks again. Nick Vatamaniuc wrote: > John, > Cycles are tricky. Python is an interpreted dynamic language, whatever > ob

Re: Cyclic class definations

2006-07-18 Thread Nick Vatamaniuc
John, Cycles are tricky. Python is an interpreted dynamic language, whatever object you instantiate in your methods is a different thing than class hierarchy. Your class hierarchy is fine: ClassA->ClassASubclass->ClassC and it should work. If it doesn't, create a quick mock example and post it alo

Re: Cyclic class definations

2006-07-18 Thread John Henry
I think I got the answer by playing around a bit. It appears you *don't* need to forward declare things. For example, the following code works: class a: def run(self): new_a=a_sub() new_a.print_it() class a_sub(a): def print_it(self): print "Hi" b=a().run() Regards, John He

Cyclic class definations

2006-07-18 Thread John Henry
Hi list, I am trying to understand better Python packaging. This might be a messed up class hierachy but how would I break this cyclic relatioship? In file A: from B import B_Class Class_A_Main(): def def SomeMethod(self): res=B_Class(self) Class_A_SubClass(Class_A_Main):