Пример #1
0
 def _post_visit(self) -> None:
     for node, for_count in self._fors.items():
         if for_count > self._max_fors:
             self.add_violation(TooManyForsInComprehensionViolation(node))
Пример #2
0
 def _check_fors(self) -> None:
     for node, for_count in self._counter.fors.items():
         if for_count > 2:
             self.add_violation(TooManyForsInComprehensionViolation(node))