PyType (@Nullable PyExpression receiver, @NotNull TypeEvalContext context) { if (mySite instanceof PyTargetExpressionImpl) { final PyType targetDocStringType = ((PyTargetExpressionImpl)mySite).getTypeFromDocString(); if (targetDocStringType != null) { return targetDocStringType; } } final PyCallable callable = myGetter.valueOrNull(); if (callable != null) { // Ignore return types of non stub-based elements if we are not allowed to use AST if (!(callable instanceof StubBasedPsiElement) && !context.maySwitchToAST(callable)) { return null; } return callable.getCallType(receiver, buildArgumentsToParametersMap(receiver, callable, context), context); } return null; }