mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Compeltion for matrix multiplication methods (PY-15390)
This commit is contained in:
@@ -357,8 +357,23 @@ public class PyNames {
|
||||
.put("__round__", new BuiltinDescription("(self, n=None)"))
|
||||
.build();
|
||||
|
||||
public static ImmutableMap<String, BuiltinDescription> PY35_BUILTIN_METHODS = ImmutableMap.<String, BuiltinDescription>builder()
|
||||
.putAll(PY3_BUILTIN_METHODS)
|
||||
.put("__imatmul__", _self_other_descr)
|
||||
.put("__matmul__", _self_other_descr)
|
||||
.put("__rmatmul__", _self_other_descr)
|
||||
.build();
|
||||
|
||||
public static ImmutableMap<String, BuiltinDescription> getBuiltinMethods(LanguageLevel level) {
|
||||
return level.isPy3K() ? PY3_BUILTIN_METHODS : PY2_BUILTIN_METHODS;
|
||||
if (level.isAtLeast(LanguageLevel.PYTHON35)) {
|
||||
return PY35_BUILTIN_METHODS;
|
||||
}
|
||||
else if (level.isAtLeast(LanguageLevel.PYTHON30)) {
|
||||
return PY3_BUILTIN_METHODS;
|
||||
}
|
||||
else {
|
||||
return PY2_BUILTIN_METHODS;
|
||||
}
|
||||
}
|
||||
|
||||
// canonical names, not forced by interpreter
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
class C:
|
||||
def __matmul__(self, other):
|
||||
@@ -0,0 +1,2 @@
|
||||
class C:
|
||||
def __matmul<caret>
|
||||
@@ -141,4 +141,14 @@ public class Py3CompletionTest extends PyTestCase {
|
||||
public void testNotImportedSubmodulesOfNamespacePackage() {
|
||||
doMultiFileTest();
|
||||
}
|
||||
|
||||
// PY-15390
|
||||
public void testMatMul() {
|
||||
runWithLanguageLevel(LanguageLevel.PYTHON35, new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
doTest();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user