mirror of
https://github.com/astral-sh/ruff.git
synced 2025-07-19 11:05:24 +00:00
[ty] Recognise functions containing yield from
expressions as being generator functions (#17930)
This commit is contained in:
parent
2cf5cba7ff
commit
51cef5a72b
3 changed files with 30 additions and 24 deletions
|
@ -2310,7 +2310,7 @@ where
|
|||
|
||||
walk_expr(self, expr);
|
||||
}
|
||||
ast::Expr::Yield(_) => {
|
||||
ast::Expr::Yield(_) | ast::Expr::YieldFrom(_) => {
|
||||
let scope = self.current_scope();
|
||||
if self.scopes[scope].kind() == ScopeKind::Function {
|
||||
self.generator_functions.insert(scope);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue