staticmethod and namespaces

darnzen darnzen at gmail.com
Thu Feb 25 23:54:41 EST 2010


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)




More information about the Python-list mailing list