[IronPython] Object is not callable on clr.accepts decorated function
doug.warren at gmail.com
Fri Aug 6 00:06:10 CEST 2010
I'm having problems with a simple WinForm, I've searched high and low
and don't see what the issue is... My problem is that when I try to
add an event handler to a window form that uses the accepts/returns
decorator, I get the error 'Object is not callable' I've made some
test apps of my own as well as tried modifying the sources of examples
I've found online and all seem to have the problem. The smallest
reproduction I've had is:
from clr import AddReference, accepts, returns, Self
from System.Windows.Forms import *
from System.ComponentModel import *
from System.Drawing import *
self.Name = 'Form1'
self.Text = 'DCC'
self.Load += self._Form1_Load
@accepts(Self(), System.Object, System.EventArgs)
def _Form1_Load(self, sender, e):
I'm running IronPython 2.6.1 from inside Eclipse with PyDev, and I get
'TypeError: Object is not callable.' on line 19. Removing the
decorators and the program executes though I'm not sure what side
effects not having the decorators would lead to.
More information about the Ironpython-users