Iteration over ancestors via PyClass.getAncestorTypes()

Iteration is no longer lazy because the C3 MRO implementation for new-style
classes will be eager anyway.
This commit is contained in:
Andrey Vlasovskikh
2013-04-16 16:02:28 +04:00
parent 50f455ed95
commit 700e7db689
2 changed files with 152 additions and 5 deletions
@@ -9,6 +9,8 @@ import com.intellij.util.ArrayFactory;
import com.intellij.util.Processor;
import com.jetbrains.python.codeInsight.controlflow.ScopeOwner;
import com.jetbrains.python.psi.stubs.PyClassStub;
import com.jetbrains.python.psi.types.PyClassType;
import com.jetbrains.python.psi.types.TypeEvalContext;
import org.jetbrains.annotations.NonNls;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -42,6 +44,9 @@ public interface PyClass extends PsiNameIdentifierOwner, PyStatement, NameDefine
@NotNull
PsiElement[] getSuperClassElements();
@NotNull
List<PyClassType> getSuperClassTypes(@NotNull TypeEvalContext context);
@NotNull
PyClass[] getSuperClasses();
@@ -113,6 +118,12 @@ public interface PyClass extends PsiNameIdentifierOwner, PyStatement, NameDefine
Iterable<PyClass> iterateAncestorClasses();
/**
* Get a list of all ancestor types.
*/
@NotNull
List<PyClassType> getAncestorTypes(@NotNull TypeEvalContext context);
/**
* Return the method resolution order list for this class.
* <br/>