Add issues if users want to assign to operators.

This commit is contained in:
Dave Halter
2017-07-26 23:08:36 +02:00
parent 6bdccd61cc
commit e776e2a13d
2 changed files with 17 additions and 0 deletions

View File

@@ -473,6 +473,17 @@ class ErrorFinder(Normalizer):
self._add_syntax_error(message, node)
elif type_ == 'test':
error = 'conditional expression'
elif type_ == 'atom_expr':
if node.children[0] == 'await':
error = 'await expression'
elif type_ in ('testlist_star_expr', 'exprlist'):
for child in node.children[::2]:
self._check_assignment(child, is_deletion)
elif ('expr' in type_ and type_ != 'star_expr' # is a substring
or '_test' in type_
or type_ in ('term', 'factor')):
error = 'operator'
print(node)
if error is not None: