@skip('multiple_execute')
def test_critical_parameterless_constructor():
 global called
 clr.AddReference('IronPythonTest')
 import IronPythonTest.interop.net.type.clrtype as IPT
 called = False
 class MyType(type, ):
  def __clrtype__(self):
   global called
   called = True
   return IPT.SanityParameterlessConstructor
 class X(object, ):
  __metaclass__ = MyType
 AreEqual(called, True)
 AreEqual(IPT.SanityParameterlessConstructor.WhichConstructor, 0)
 py_x = X()
 AreEqual(IPT.SanityParameterlessConstructor.WhichConstructor, 1)
 cs_x = IPT.Factory.Get[X]()
 AreEqual(IPT.SanityParameterlessConstructor.WhichConstructor, 2)
 AreEqual(type(py_x), type(cs_x))

@ skip ( 'multiple_execute' ) def test_critical_parameterless_constructor ( ) : global called clr . AddReference ( 'IronPythonTest' ) import IronPythonTest . interop . net . type . clrtype as IPT called = False class MyType ( type , ) : def __clrtype__ ( self ) : global called called = True return IPT . SanityParameterlessConstructor class X ( object , ) : __metaclass__ = MyType AreEqual ( called , True ) AreEqual ( IPT . SanityParameterlessConstructor . WhichConstructor , 0 ) py_x = X ( ) AreEqual ( IPT . SanityParameterlessConstructor . WhichConstructor , 1 ) cs_x = IPT . Factory . Get [ X ] ( ) AreEqual ( IPT . SanityParameterlessConstructor . WhichConstructor , 2 ) AreEqual ( type ( py_x ) , type ( cs_x ) )
ensure that csharp can new up a python type that has a parameterless constructor .