コード例 #1
0
 def _check_unpacking_targets(
     self,
     node: ast.AST,
     targets: Iterable[ast.AST],
 ) -> None:
     for target in targets:
         target_name = extract_name(target)
         if target_name is None:  # it means, that non name node was used
             self.add_violation(WrongUnpackingViolation(node))
コード例 #2
0
 def _check_unpacking_targets(
     self,
     node: ast.AST,
     targets: Iterable[ast.AST],
 ) -> None:
     for target in targets:
         if isinstance(target, ast.Starred):
             target = target.value
         if not isinstance(target, ast.Name):
             self.add_violation(WrongUnpackingViolation(node))