[python] PY-28130 infer lambda parameter type from expected type

GitOrigin-RevId: e98338828b8fb9b2b3e33c57995345731f53dccb
This commit is contained in:
Morgan Bartholomew
2025-10-12 20:25:42 +10:00
committed by intellij-monorepo-bot
parent cc0b12cef3
commit 470e4f879a
9 changed files with 278 additions and 80 deletions

View File

@@ -59,6 +59,15 @@ public interface PyParameterList extends PyAstParameterList, PyElement, StubBase
@NotNull
String getPresentableText(boolean includeDefaultValue, @Nullable TypeEvalContext context);
/**
* @deprecated migrate to `getContainingCallable`
*/
@Deprecated
@Nullable
PyFunction getContainingFunction();
default PyFunction getContainingFunction() {
return getContainingCallable() instanceof PyFunction function ? function : null;
}
@Nullable
PyCallable getContainingCallable();
}