1
0
forked from VimPlug/jedi

Avoid the need to import search_ancestor

This commit is contained in:
Dave Halter
2026-01-19 20:30:03 +01:00
parent 4a7b5f4879
commit 3ac1632a5c
13 changed files with 28 additions and 44 deletions

View File

@@ -262,8 +262,8 @@ class BaseFunctionExecutionContext(ValueContext, TreeContextMixin):
@recursion.execution_recursion_decorator(default=iter([]))
def get_yield_lazy_values(self, is_async=False):
# TODO: if is_async, wrap yield statements in Awaitable/async_generator_asend
for_parents = [(y, tree.search_ancestor(y, 'for_stmt', 'funcdef',
'while_stmt', 'if_stmt'))
for_parents = [(y, y.search_ancestor('for_stmt', 'funcdef',
'while_stmt', 'if_stmt'))
for y in get_yield_exprs(self.inference_state, self.tree_node)]
# Calculate if the yields are placed within the same for loop.