def test_interesting_type_implementations():
 global called
 clr.AddReference('IronPythonTest')
 import IronPythonTest.interop.net.type.clrtype as IPT
 from IronPython.Runtime.Types import PythonType
 for x in [IPT.Sanity, IPT.SanityGeneric[int], IPT.SanityGenericConstructor[PythonType], IPT.SanityDerived, IPT.SanityUniqueConstructor, IPT.SanityNoIPythonObject]:
  called = False
  class MyType(type, ):
   def __clrtype__(self):
    global called
    called = True
    return x
  class X(object, ):
   __metaclass__ = MyType
  AreEqual(called, True)
  if (x != IPT.SanityUniqueConstructor):
   temp = X()
   if (x == IPT.SanityNoIPythonObject):
    AreEqual(type(temp), x)
   else:
    AreEqual(type(temp), X)

def test_interesting_type_implementations ( ) : global called clr . AddReference ( 'IronPythonTest' ) import IronPythonTest . interop . net . type . clrtype as IPT from IronPython . Runtime . Types import PythonType for x in [ IPT . Sanity , IPT . SanityGeneric [ int ] , IPT . SanityGenericConstructor [ PythonType ] , IPT . SanityDerived , IPT . SanityUniqueConstructor , IPT . SanityNoIPythonObject ] : called = False class MyType ( type , ) : def __clrtype__ ( self ) : global called called = True return x class X ( object , ) : __metaclass__ = MyType AreEqual ( called , True ) if ( x != IPT . SanityUniqueConstructor ) : temp = X ( ) if ( x == IPT . SanityNoIPythonObject ) : AreEqual ( type ( temp ) , x ) else : AreEqual ( type ( temp ) , X )
test types that have been fully implemented in csharp .