mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 15:09:39 +07:00
This commit is contained in:
@@ -51,7 +51,6 @@ import com.intellij.util.IncorrectOperationException;
|
||||
import com.intellij.util.PlatformIcons;
|
||||
import com.intellij.util.SmartList;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.containers.HashSet;
|
||||
import com.jetbrains.python.PyBundle;
|
||||
import com.jetbrains.python.PyNames;
|
||||
import com.jetbrains.python.PyTokenTypes;
|
||||
@@ -964,6 +963,17 @@ public class PyUtil {
|
||||
while (value instanceof PyParenthesizedExpression) {
|
||||
value = ((PyParenthesizedExpression)value).getContainedExpression();
|
||||
}
|
||||
if (value instanceof PyReferenceExpression) {
|
||||
PyReferenceExpression refExpr = (PyReferenceExpression)value;
|
||||
PsiElement deref = refExpr.getReference().resolve();
|
||||
if (deref instanceof PyTargetExpression) {
|
||||
PyTargetExpression te = (PyTargetExpression)deref;
|
||||
PyExpression assignedValue = te.findAssignedValue();
|
||||
if (assignedValue instanceof PySequenceExpression) {
|
||||
value = assignedValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (value instanceof PySequenceExpression) {
|
||||
final PyExpression[] elements = ((PySequenceExpression)value).getElements();
|
||||
List<String> result = new ArrayList<String>(elements.length);
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
class A(object):
|
||||
__slots__ = ['a', 'b']
|
||||
|
||||
def __init__(self):
|
||||
self.a = None # <- all ok here
|
||||
self.b = None # <- all ok here
|
||||
|
||||
|
||||
class B(A):
|
||||
__slots__ = A.__slots__
|
||||
|
||||
def __init__(self):
|
||||
super(B, self).__init__()
|
||||
self.<warning descr="'B' object has no attribute 'c'">c</warning> = 'bug'
|
||||
|
||||
|
||||
EXTERNAL_SLOTS = ['a', 'b']
|
||||
|
||||
|
||||
class C(A):
|
||||
__slots__ = EXTERNAL_SLOTS
|
||||
|
||||
def __init__(self):
|
||||
super(C, self).__init__()
|
||||
self.<warning descr="'C' object has no attribute 'c'">c</warning> = 'bug'
|
||||
@@ -52,6 +52,10 @@ public class PyUnresolvedReferencesInspectionTest extends PyInspectionTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testSlotsAsExternal() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
public void testImportExceptImportError() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user