Analyses the 'comp_for' part of comprehensions (part 1). That is the part after 'for' in (x for x in l if p). This analyzes variables and conditions which are analyzed in a local scope.
(self, expr: GeneratorExpr | DictionaryComprehension)
| 6388 | self.analyze_comp_for_2(expr) |
| 6389 | |
| 6390 | def analyze_comp_for(self, expr: GeneratorExpr | DictionaryComprehension) -> None: |
| 6391 | """Analyses the 'comp_for' part of comprehensions (part 1). |
| 6392 | |
| 6393 | That is the part after 'for' in (x for x in l if p). This analyzes |
| 6394 | variables and conditions which are analyzed in a local scope. |
| 6395 | """ |
| 6396 | for i, (index, sequence, conditions) in enumerate( |
| 6397 | zip(expr.indices, expr.sequences, expr.condlists) |
| 6398 | ): |
| 6399 | if i > 0: |
| 6400 | sequence.accept(self) |
| 6401 | # Bind index variables. |
| 6402 | self.analyze_lvalue(index) |
| 6403 | for cond in conditions: |
| 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). |
no test coverage detected