Check if an AST contains yields or yield froms.
| 2224 | |
| 2225 | |
| 2226 | class FindYield(TraverserVisitor): |
| 2227 | """Check if an AST contains yields or yield froms.""" # codespell:ignore froms |
| 2228 | |
| 2229 | def __init__(self) -> None: |
| 2230 | self.found = False |
| 2231 | |
| 2232 | def visit_yield_expr(self, e: YieldExpr) -> None: |
| 2233 | self.found = True |
| 2234 | |
| 2235 | def visit_yield_from_expr(self, e: YieldFromExpr) -> None: |
| 2236 | self.found = True |
| 2237 | |
| 2238 | |
| 2239 | def is_possible_trivial_body(s: list[Statement]) -> bool: |
no outgoing calls
no test coverage detected
searching dependent graphs…