mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
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:
@@ -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/>
|
||||
|
||||
Reference in New Issue
Block a user