[IronPython] PythonType.CreateInstance not calling __init__

2008-02-09 Thread Curt Hagenlocher
The following code creates a Python class foo with a single method __init__. It then gets the class object. string code = class foo(object):\n\tdef __init__(self):\n\t\tprint 'hello world'\n; SourceUnit scriptSource = PythonEngine.CurrentEngine.CreateScriptSourceFromString(code,

Re: [IronPython] PythonType.CreateInstance not calling __init__

2008-02-09 Thread Curt Hagenlocher
A little more poking suggests that CreateInstance._ctor is really the equivalent of __new__ and not __init__. I changed the code to say PythonTypeOps.TypeCaller ctor = new PythonTypeOps.TypeCaller(theClass); object foo = ctor.Call(context); and all is now well with the world. On Feb 9,