def _post_visit(self) -> None: for node, for_count in self._fors.items(): if for_count > self._max_fors: self.add_violation(TooManyForsInComprehensionViolation(node))
def _check_fors(self) -> None: for node, for_count in self._counter.fors.items(): if for_count > 2: self.add_violation(TooManyForsInComprehensionViolation(node))