[IronPython] Need help to port-dynamic class generation code to IP2

Curt Hagenlocher curt at hagenlocher.org
Sun Apr 20 22:01:29 CEST 2008

On Sun, Apr 20, 2008 at 6:13 AM, เสกสรรค์ <sakesun at boonthavorn.com> wrote:
> print 'in 2.0 any action perform to "w" will cause system to halt'
> w.show()

Evaluation gets stuck in an infinite loop in ActionBinder.UpdateSiteAndExecute.

The fact that __init__ isn't called is pretty strong evidence that
part of the initialization process is being skipped when you call the
constructor directly.  In the case of IronPython 1.x, this is
apparently not fatal -- but not so IP 2.0.

The normal construction process for a new object is triggered by a
__call__ to the type object.  In 2.0, this gets handled by the method
PythonCallBinderHelper<T>.MakePythonTypeCallRule, which generates the
DLR expression tree that will actually implement the construction.  It
doesn't look like it would look very easy to hook into this object
creation process.

I take it that you need to provide the library with a Type object?

Curt Hagenlocher
curt at hagenlocher.org

More information about the Ironpython-users mailing list