[IronPython] Constructor overloading

Andrzej Krzywda andrzej.krzywda at resolversystems.com
Wed Jul 5 16:19:56 CEST 2006


Hello all,

We are trying to create a .Net type object which has several 
one-parameter constructors.
By default it does the wrong thing and we want to specify which 
constructor is called.

We tried:

Icon.__overloads__[Stream](myStream)
Icon.__init__.__new__.__overloads__[Stream](myStream)

but neither of these methods work. How can we do it?

We also attempted to work around the issue by using Reflection on the 
Icon class:

typeof(Icon).GetConstructor([Stream]).Invoke([myStream])

but we can't find the IronPython equivalent of typeof. Does it exist?

--
Andrzej Krzywda





More information about the Ironpython-users mailing list