private synchronized static PyType createType(Class<?> c, Set<PyJavaType> needsInners) { // System.out.println("createType c=" + c + ", needsInners=" + needsInners + ", BootstrapTypesSingleton.getInstance()=" + BootstrapTypesSingleton.getInstance()); PyType newtype; if (c == PyType.class) { newtype = new PyType(false); } else if (BootstrapTypesSingleton.getInstance().contains(c) || getBuilder(c) != null) { newtype = new PyType(); } else { newtype = new PyJavaType(); } // If filling in the type above filled the type under creation, use that one PyType type = class_to_type.get(c); if (type != null) { return type; } class_to_type.put(c, newtype); newtype.builtin = true; newtype.init(c, needsInners); newtype.invalidateMethodCache(); return newtype; }
if (new_.for_type == metatype) { type = new PyType(); } else { type = new PyTypeDerived(metatype);