Update skeletons for max function

This commit is contained in:
Semyon Proshev
2016-11-29 20:32:25 +03:00
parent c60419eb7e
commit 60edb30580
4 changed files with 30 additions and 9 deletions
@@ -219,6 +219,16 @@ def min(*args, key=None, default=None):
pass
def max(*args, key=None, default=None):
"""Return the largest item in an iterable or the largest of two or more
arguments.
:type args: T
:rtype: T
"""
pass
def next(iterator, default=None):
"""Return the next item from the iterator.
+10 -9
View File
@@ -189,15 +189,6 @@ def locals():
return {}
def max(*args, key=None, default=None):
"""Return the largest item in an iterable or the largest of two or more
arguments.
:rtype: object | unknown
"""
pass
class map(object):
def __init__(self, function, sequence, *sequence_1):
"""Return an iterable of the results of applying the function to the items of
@@ -231,6 +222,16 @@ def min(*args, key=None, default=None):
pass
def max(*args, key=None, default=None):
"""Return the largest item in an iterable or the largest of two or more
arguments.
:type args: T
:rtype: T
"""
pass
def next(iterator, default=None):
"""Return the next item from the iterator.
@@ -470,6 +470,11 @@ public class Py3TypeTest extends PyTestCase {
"expr = min(1, 2, 3)");
}
public void testMaxResult() {
doTest("int",
"expr = max(1, 2, 3)");
}
private void doTest(final String expectedType, final String text) {
myFixture.configureByText(PythonFileType.INSTANCE, text);
final PyExpression expr = myFixture.findElementByText("expr", PyExpression.class);
@@ -1519,6 +1519,11 @@ public class PyTypeTest extends PyTestCase {
"expr = min(1, 2, 3)");
}
public void testMaxResult() {
doTest("int",
"expr = max(1, 2, 3)");
}
private static List<TypeEvalContext> getTypeEvalContexts(@NotNull PyExpression element) {
return ImmutableList.of(TypeEvalContext.codeAnalysis(element.getProject(), element.getContainingFile()).withTracing(),
TypeEvalContext.userInitiated(element.getProject(), element.getContainingFile()).withTracing());