[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

staticmethod and namespaces

darnzen

2/26/2010 4:55:00 AM

Having an odd problem that I solved, but wondering if its the best
solution (seems like a bit of a hack).

First off, I'm using an external DLL that requires static callbacks,
but because of this, I'm losing instance info. It will make more sense
after I diagram it:

#Module main.py

class App:
def sperg(self):
pass

app = App()
[main loop and such]
-----------------------------
# Module A.py
import main
class Foo:
@staticmethod
chum(nType, nPtr):
# Need to access function / data in app instance
app.sperg(nType, nPtr)