public static PythonModule MakeModule(ICallerContext context, DynamicType cls, params object[] args\u03c4) { if (cls.IsSubclassOf(TypeCache.Module)) { return new PythonModule(context); } throw Ops.TypeError("{0} is not a subtype of module", cls.__name__); }
private bool ShouldInvokeInit(DynamicType newObjectType, int argCnt) { // don't run __init__ if it's not a subclass of ourselves, // or if this is the user doing type(x) return newObjectType.IsSubclassOf(this) && (this != TypeCache.DynamicType || argCnt > 1); }