PyType (@NotNull TypeEvalContext context, @NotNull TypeEvalContext.Key key) { final PyExpression e = getExpression(); final PyType type = e != null ? context.getType(e) : null; if (isDelegating()) { final Ref<PyType> generatorElementType = PyTypingTypeProvider.coroutineOrGeneratorElementType(type); return generatorElementType == null ? PyNoneType.INSTANCE : generatorElementType.get(); } return type; }