Skip to content

find_withitems

faststream.utils.ast.find_withitems #

find_withitems(node)
Source code in faststream/utils/ast.py
def find_withitems(node: Union[ast.With, ast.AsyncWith]) -> Iterator[ast.withitem]:
    if isinstance(node, (ast.With, ast.AsyncWith)):
        yield from node.items

    for i in getattr(node, "body", ()):
        yield from find_withitems(i)