MCPcopy Index your code
hub / github.com/python/mypy / GeneratorExpr

Class GeneratorExpr

mypy/nodes.py:2986–3015  ·  view source on GitHub ↗

Generator expression ... for ... in ... [ for ... in ... ] [ if ... ].

Source from the content-addressed store, hash-verified

2984
2985
2986class GeneratorExpr(Expression):
2987 """Generator expression ... for ... in ... [ for ... in ... ] [ if ... ]."""
2988
2989 __slots__ = ("left_expr", "sequences", "condlists", "is_async", "indices")
2990
2991 __match_args__ = ("left_expr", "indices", "sequences", "condlists")
2992
2993 left_expr: Expression
2994 sequences: list[Expression]
2995 condlists: list[list[Expression]]
2996 is_async: list[bool]
2997 indices: list[Lvalue]
2998
2999 def __init__(
3000 self,
3001 left_expr: Expression,
3002 indices: list[Lvalue],
3003 sequences: list[Expression],
3004 condlists: list[list[Expression]],
3005 is_async: list[bool],
3006 ) -> None:
3007 super().__init__()
3008 self.left_expr = left_expr
3009 self.sequences = sequences
3010 self.condlists = condlists
3011 self.indices = indices
3012 self.is_async = is_async
3013
3014 def accept(self, visitor: ExpressionVisitor[T]) -> T:
3015 return visitor.visit_generator_expr(self)
3016
3017
3018class ListComprehension(Expression):

Callers 3

visit_GeneratorExpMethod · 0.90
duplicate_generatorMethod · 0.90
read_generator_exprFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…