I have 64bit CPython 3.4 installation on windows7. I use the pythonnet package (2.0.0.dev1). I want to instantiate the action delegate, but it gives me an error.
def display(num):
print("num=", num)
import clr
clr.AddReference("System")
import System
paction=System.Action[System.Int32](display)
I get this error:
TypeError Traceback (most recent call last) in () ----> 1 paction=System.Action[System.Int32](display) TypeError: unsubscriptable object
I guess this is the way one shall specify generics.
I have checked the docu and this post, and still do not see the problem. I also palyed around a bit with the Overload method, but did not help either:
paction=System.Action.Overloads[System.Int32](display)
TypeError Traceback (most recent call last) in () ----> 1 paction=System.Action.Overloads[System.Int32](display) TypeError: No match found for constructor signature