mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 13:02:30 +07:00
'callable()' assertion specifies qualified 'collections.Callable' type (PY-12004)
This commit is contained in:
@@ -84,7 +84,7 @@ public class PyTypeAssertionEvaluator extends PyRecursiveElementVisitor {
|
||||
@Override
|
||||
public PyType getType(TypeEvalContext context, PsiElement anchor) {
|
||||
final List<PyType> types = new ArrayList<PyType>();
|
||||
types.add(PyTypeParser.getTypeByName(target, PyNames.CALLABLE));
|
||||
types.add(PyTypeParser.getTypeByName(target, "collections." + PyNames.CALLABLE));
|
||||
return createAssertionType(context.getType(target), types, positive, context);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
class Callable(object):
|
||||
pass
|
||||
|
||||
|
||||
def f(g):
|
||||
if callable(g):
|
||||
g()
|
||||
@@ -94,6 +94,11 @@ public class PyCallingNonCallableInspectionTest extends PyTestCase {
|
||||
doTest();
|
||||
}
|
||||
|
||||
// PY-12004
|
||||
public void testLocalCallableClass() {
|
||||
doTest();
|
||||
}
|
||||
|
||||
private void doTest() {
|
||||
setLanguageLevel(LanguageLevel.PYTHON27);
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user