boolean (@NotNull List<PyClassLikeType> ancestorTypes, @NotNull TypeEvalContext context) { final List<PyClass> classes = new ArrayList<>(); classes.add(this); for (PyClassLikeType ancestorType : ancestorTypes) { if (ancestorType instanceof PyClassType classType) { classes.add(classType.getPyClass()); } } final PyClass typeClass = PyBuiltinCache.getInstance(this).getClass("type"); for (PyClass cls : classes) { final PyType metaClassType = cls.getMetaClassType(context); if (metaClassType instanceof PyClassType) { final PyClass metaClass = ((PyClassType)metaClassType).getPyClass(); if (cls == metaClass) { return false; } final PyFunction mroMethod = metaClass.findMethodByName(PyNames.MRO, true, null); if (mroMethod != null) { final PyClass mroClass = mroMethod.getContainingClass(); if (mroClass != null && mroClass != typeClass) { return true; } } } } return false; }