PyType (@NotNull PyClass pyClass, TypeEvalContext context) { // TODO: this is closer to being correct than simply taking first superclass type but still not entirely correct; // super can also delegate to sibling types // TODO handle __mro__ here final PyClass[] supers = pyClass.getSuperClasses(context); if (supers.length > 0) { if (supers.length == 1) { return new PyClassTypeImpl(supers[0], false); } List<PyType> superTypes = new ArrayList<>(); for (PyClass aSuper : supers) { superTypes.add(new PyClassTypeImpl(aSuper, false)); } return PyUnionType.union(superTypes); } return null; }