mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-08-26 15:27:45 +07:00
PY-79067 Allow creating PyCallableType directly with PyCallableParameterVariadicType instead of wrapping it in the list of callable parameters
This refactoring allows simplifying and unifying logic whilst calculating substitutions for callable types and its matching in `PyTypeChecker` GitOrigin-RevId: e61bd1f6cf19539b0a66ff2e3e47164aec0c0aa1
This commit is contained in:
committed by
intellij-monorepo-bot
parent
5c277c03f8
commit
6e2c7614ca
@@ -47,6 +47,21 @@ public interface PyCallableType extends PyType {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the parameters type as a variadic type.
|
||||
* This method provides a unified way to handle different forms of callable parameters:
|
||||
* <ul>
|
||||
* <li>{@link PyCallableParameterListType} for regular parameter lists</li>
|
||||
* <li>{@link PyParamSpecType} for a single ParamSpec parameter type <code>Callable[P, R]</code></li>
|
||||
* <li>{@link PyConcatenateType} for a single Concatenate type <code>Callable[Concatenate[T1, T2, P], R]</code></li>
|
||||
* </ul>
|
||||
* @return the parameters type, or null if not applicable
|
||||
*/
|
||||
@ApiStatus.Experimental
|
||||
default @Nullable PyCallableParameterVariadicType getParametersType(@NotNull TypeEvalContext context) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
default String getName() {
|
||||
|
||||
Reference in New Issue
Block a user