Skip to content

Commit

Permalink
Use interable unpacking now that mypyc supports it (#6946)
Browse files Browse the repository at this point in the history
  • Loading branch information
msullivan authored and ilevkivskyi committed Jun 7, 2019
1 parent bd0d039 commit d51d85b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
4 changes: 1 addition & 3 deletions mypy/newsemanal/semanal.py
Expand Up @@ -2973,9 +2973,7 @@ def process_module_assignment(self, lvals: List[Lvalue], rval: Expression,
# extra elements, so no error will be raised here; mypy will later complain
# about the length mismatch in type-checking.
elementwise_assignments = zip(rval.items, *[v.items for v in seq_lvals])
# TODO: use 'for rv, *lvs in' once mypyc supports it
for part in elementwise_assignments:
rv, lvs = part[0], list(part[1:])
for rv, *lvs in elementwise_assignments:
self.process_module_assignment(lvs, rv, ctx)
elif isinstance(rval, RefExpr):
rnode = self.lookup_type_node(rval)
Expand Down
4 changes: 1 addition & 3 deletions mypy/semanal.py
Expand Up @@ -2660,9 +2660,7 @@ def process_module_assignment(self, lvals: List[Lvalue], rval: Expression,
# extra elements, so no error will be raised here; mypy will later complain
# about the length mismatch in type-checking.
elementwise_assignments = zip(rval.items, *[v.items for v in seq_lvals])
# TODO: use 'for rv, *lvs in' once mypyc supports it
for part in elementwise_assignments:
rv, lvs = part[0], list(part[1:])
for rv, *lvs in elementwise_assignments:
self.process_module_assignment(lvs, rv, ctx)
elif isinstance(rval, RefExpr):
rnode = self.lookup_type_node(rval)
Expand Down

0 comments on commit d51d85b

Please sign in to comment.