Fixed type of 'iter()' built-in function (PY-10854)

This commit is contained in:
Andrey Vlasovskikh
2013-09-22 20:39:28 +04:00
parent f0a46d461b
commit 86ce6e030b
2 changed files with 21 additions and 0 deletions
@@ -0,0 +1,16 @@
def test_second_form():
def f():
return ''
for chunk in iter(lambda: f(), ''):
pass
def test_second_form_fail():
for chunk in iter(<weak_warning descr="Expected type 'Iterable | () -> object' (matched generic type 'Iterable[T] | () -> object'), got 'int' instead">10</weak_warning>, ''):
pass
def test_first_form():
for x in iter([1, 2, 3]):
pass
@@ -208,4 +208,9 @@ public class PyTypeCheckerInspectionTest extends PyTestCase {
public void testStringStartsWith() {
doTest();
}
// PY-10854
public void testSecondFormIter() {
doTest();
}
}