Skip to content

Commit

Permalink
Merge ifs
Browse files Browse the repository at this point in the history
  • Loading branch information
tusharsadhwani committed Oct 29, 2022
1 parent 3893d31 commit 3870170
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pyupgrade/_plugins/typing_pep646_unpack.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ def visit_Subscript(
if state.settings.min_version < (3, 11):
return

if is_name_attr(node.value, state.from_imports, ('typing',), ('Unpack',)):
if isinstance(parent, (ast.Subscript, ast.Index)):
yield ast_to_offset(node.value), _replace_unpack_with_star
if (
is_name_attr(
node.value, state.from_imports, ('typing',), ('Unpack',),
) and isinstance(parent, (ast.Subscript, ast.Index))
):
yield ast_to_offset(node.value), _replace_unpack_with_star

0 comments on commit 3870170

Please sign in to comment.