mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
extract interface from PyClassType
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
package com.jetbrains.python.psi.types;
|
||||
|
||||
import com.jetbrains.python.psi.PyQualifiedExpression;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* A type instances of which can possibly be called. For example, a class definition can be called, and the result of a call is a class
|
||||
* instance.
|
||||
*
|
||||
* @author yole
|
||||
*/
|
||||
public interface PyCallableType extends PyType {
|
||||
/**
|
||||
* Returns the type which is the result of calling an instance of this type.
|
||||
*
|
||||
* @return the call result type or null if invalid.
|
||||
* @param context
|
||||
* @param callSite
|
||||
*/
|
||||
@Nullable
|
||||
PyType getCallType(@NotNull TypeEvalContext context, @Nullable PyQualifiedExpression callSite);
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
package com.jetbrains.python.psi.types;
|
||||
|
||||
import com.intellij.openapi.util.UserDataHolder;
|
||||
import com.jetbrains.python.psi.PyClass;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
/**
|
||||
* @author yole
|
||||
*/
|
||||
public interface PyClassType extends PyCallableType, UserDataHolder {
|
||||
@Nullable
|
||||
PyClass getPyClass();
|
||||
|
||||
boolean isDefinition();
|
||||
|
||||
PyClassType toInstance();
|
||||
|
||||
@Nullable
|
||||
String getClassQName();
|
||||
|
||||
boolean isValid();
|
||||
}
|
||||
Reference in New Issue
Block a user