Added __next__() and next() special methods to class-level completion (PY-11214)

This commit is contained in:
Andrey Vlasovskikh
2015-05-07 19:49:45 +03:00
parent afeac88a49
commit 897b896fca
7 changed files with 20 additions and 0 deletions
@@ -347,6 +347,7 @@ public class PyNames {
.putAll(BuiltinMethods)
.put("__nonzero__", _only_self_descr)
.put("__div__", _self_other_descr)
.put(NEXT, _only_self_descr)
.build();
public static ImmutableMap<String, BuiltinDescription> PY3_BUILTIN_METHODS = ImmutableMap.<String, BuiltinDescription>builder()
@@ -355,6 +356,7 @@ public class PyNames {
.put("__bytes__", _only_self_descr)
.put("__format__", new BuiltinDescription("(self, format_spec)"))
.put("__round__", new BuiltinDescription("(self, n=None)"))
.put(DUNDER_NEXT, _only_self_descr)
.build();
public static ImmutableMap<String, BuiltinDescription> PY35_BUILTIN_METHODS = ImmutableMap.<String, BuiltinDescription>builder()
@@ -0,0 +1,2 @@
class C:
def __next__(self):
+2
View File
@@ -0,0 +1,2 @@
class C:
def __nex<caret>
+2
View File
@@ -0,0 +1,2 @@
class C:
def next(self):
+2
View File
@@ -0,0 +1,2 @@
class C:
def nex<caret>
@@ -151,4 +151,9 @@ public class Py3CompletionTest extends PyTestCase {
}
});
}
// PY-11214
public void testDunderNext() {
doTest();
}
}
@@ -770,4 +770,9 @@ public class PythonCompletionTest extends PyTestCase {
public void testStructuralType() {
doTest();
}
// PY-11214
public void testNext() {
doTest();
}
}