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

Method analyze_comp_for_2

mypy/semanal.py:6406–6412  ·  view source on GitHub ↗

Analyses the 'comp_for' part of comprehensions (part 2). That is the part after 'for' in (x for x in l if p). This analyzes the 'l' part which is analyzed in the surrounding scope.

(self, expr: GeneratorExpr | DictionaryComprehension)

Source from the content-addressed store, hash-verified

6404 cond.accept(self)
6405
6406 def analyze_comp_for_2(self, expr: GeneratorExpr | DictionaryComprehension) -> None:
6407 """Analyses the 'comp_for' part of comprehensions (part 2).
6408
6409 That is the part after 'for' in (x for x in l if p). This analyzes
6410 the 'l' part which is analyzed in the surrounding scope.
6411 """
6412 expr.sequences[0].accept(self)
6413
6414 def visit_lambda_expr(self, expr: LambdaExpr) -> None:
6415 self.analyze_arg_initializers(expr)

Callers 2

visit_generator_exprMethod · 0.95

Calls 1

acceptMethod · 0.45

Tested by

no test coverage detected