PyType (@NotNull TypeEvalContext context, @NotNull TypeEvalContext.Key key) { final PyExpression indexExpression = getIndexExpression(); final PyType type = indexExpression != null ? context.getType(getOperand()) : null; if (type instanceof PyTupleType tupleType) { return Optional .ofNullable(PyEvaluator.evaluate(indexExpression, Integer.class)) .map(tupleType::getElementType) .orElse(null); } if (type instanceof PyTypedDictType typedDictType) { return Optional .ofNullable(PyEvaluator.evaluate(indexExpression, String.class)) .map(typedDictType::getElementType) .orElse(null); } return PyCallExpressionHelper.getCallType(this, context, key); }