コード例 #1
0
 def _check_ifs(self, node: ast.comprehension) -> None:
     if len(node.ifs) > 1:
         self.add_violation(MultipleIfsInComprehensionViolation(node))
コード例 #2
0
 def _check_ifs(self, node: ast.comprehension) -> None:
     if len(node.ifs) > self._max_ifs:
         # We are trying to fix line number in the report,
         # since `comprehension` does not have this property.
         parent = get_parent(node) or node
         self.add_violation(MultipleIfsInComprehensionViolation(parent))