mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
PY-20063 Fixed: Code introspection / autocomplete does not resolve types in Sets (and perhaps other collection types) when used with single-character iteration expressions
Add skeletons for set.__iter__
This commit is contained in:
@@ -2349,6 +2349,12 @@ class set(object):
|
||||
"""
|
||||
return False
|
||||
|
||||
def __iter__(self):
|
||||
"""
|
||||
:rtype: collections.Iterator[T]
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
class frozenset(object):
|
||||
"""frozenset object."""
|
||||
|
||||
@@ -2039,6 +2039,12 @@ class set(object):
|
||||
"""
|
||||
return False
|
||||
|
||||
def __iter__(self):
|
||||
"""
|
||||
:rtype: collections.Iterator[T]
|
||||
"""
|
||||
pass
|
||||
|
||||
|
||||
class frozenset(object):
|
||||
"""frozenset object."""
|
||||
|
||||
@@ -1102,6 +1102,14 @@ public class PyTypeTest extends PyTestCase {
|
||||
TypeEvalContext.userInitiated(expr.getProject(), expr.getContainingFile()));
|
||||
}
|
||||
|
||||
// PY-20063
|
||||
public void testIteratedSetElement() {
|
||||
doTest("int",
|
||||
"xs = {1}\n" +
|
||||
"for expr in xs:\n" +
|
||||
" print(expr)");
|
||||
}
|
||||
|
||||
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());
|
||||
|
||||
Reference in New Issue
Block a user