extract interface from PyClassType

This commit is contained in:
Dmitry Jemerov
2012-08-09 13:21:34 +02:00
parent ae18478861
commit 408b9e0116
22 changed files with 77 additions and 66 deletions
@@ -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();
}