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

Class ListComprehension

mypy/nodes.py:3018–3032  ·  view source on GitHub ↗

List comprehension (e.g. [x + 1 for x in a])

Source from the content-addressed store, hash-verified

3016
3017
3018class ListComprehension(Expression):
3019 """List comprehension (e.g. [x + 1 for x in a])"""
3020
3021 __slots__ = ("generator",)
3022
3023 __match_args__ = ("generator",)
3024
3025 generator: GeneratorExpr
3026
3027 def __init__(self, generator: GeneratorExpr) -> None:
3028 super().__init__()
3029 self.generator = generator
3030
3031 def accept(self, visitor: ExpressionVisitor[T]) -> T:
3032 return visitor.visit_list_comprehension(self)
3033
3034
3035class SetComprehension(Expression):

Callers 3

visit_ListCompMethod · 0.90
read_expressionFunction · 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…