The grammar for del statement:
del_stmt: 'del' (expr|star_expr) (',' (expr|star_expr))* [',']
It allows deleting starred expressions. So, the parser doesn't mind this, even though it would be causing SyntaxError: can't use starred expression here at runtime:
>>> ast.parse("del *a")
<_ast.Module at 0xcafef00d>
>>> ast.dump(compile('del *a', filename='wtf.py', mode='single', flags=ast.PyCF_ONLY_AST))
"Interactive(body=[Delete(targets=[Starred(value=Name(id='a', ctx=Del()), ctx=Del())])])"
Is there some usage I'm missing which can have a starred delete target? Shouldn't it be instead the simpler grammar:
del_stmt: 'del' expr (',' expr)* [',']
Why does the grammar allow for deleting starred expressions?