From: John G. <jgo...@co...> - 2001-09-05 14:01:13
|
Kevin Butler <kb...@ca...> writes: > What you can do is cheat in one of two ways: OK, now the question is, where do I put the @sig line for Java to be able to call it, and how should it look? > class XGo: > """Callable object to act as a static method""" > def __call__( self, id ): > print "called XGo(%s)" % id > > class XStatics: > def go( self, id ): > """Use the bound method as a static method""" > print "called XStatics.go(%s)" % id > # ... and other "static" methods > > > class X: > go = XGo() > __xstatics = XStatics() > go2=__xstatics.go > # ... and other static methods > > X.go( "asdf" ) > X.go2( "zxcv") > > Then executing that from emacs: > > Jython 2.1a1 on java1.3.0 (JIT: null) > Type "copyright", "credits" or "license" for more information. > ## working on region in file d:/TEMP/python-289AX1... >>>> called XGo(asdf) > called XStatics.go(zxcv) >>>> > > kb > > _______________________________________________ > Jython-users mailing list > Jyt...@li... > https://lists.sourceforge.net/lists/listinfo/jython-users -- John Goerzen <jgo...@co...> GPG: 0x8A1D9A1F www.complete.org |