Hi,<br><br>I have two classes in separate python modules and I need to access some methods of the either classes from the other. They are not in base and derived class relationship.<br><br>Please see the example below. Foo imports Bar and inside the Foo class it creates a Bar obj and then calls Bar.barz(). Now before returning control, it has to call the track method in Foo.<br>
<br>As I understand, I won't be able to use 'super' in this case, as there is no inheritance here. Also, I won't be able to move the track method to Bar as I need to track different bar types. <br><br>Any suggestion on how to get this done would be great. Thanks in advance.<br>
<br>Cheers<br>- b<br><br>----------<br><br>* foo.py *<br><br>import bar<br>class Foo:<br> def fooz():<br> print "Hello World"<br> b = Bar()<br> c = b.barz()<br> ...<br><br> def track(track_var):<br>
count += 1<br> return sth2<br><br><br>
* bar.py *<br>class Bar:<br> def barz():<br> track_this = ...<br> if Foo.track(track_this):<br> pass<br> else:<br> ...<br> return sth1<br><br>