Exemple #1
0
 def _check_literal_compare(self, node: ast.Compare) -> None:
     last_was_literal = is_literal(node.left)
     for comparator in node.comparators:
         next_is_literal = is_literal(comparator)
         if last_was_literal and next_is_literal:
             self.add_violation(ConstantComparisonViolation(node))
             break
         last_was_literal = next_is_literal