On Thu, Mar 12, 2020 at 10:43 AM Andrew Barnert via Python-ideas email@example.com wrote:
Also, you need to think through what happens with a del expression inside all kinds of contexts that currently can’t have del—eval, lambdas and comprehensions (can I del something from the outer scope?), etc.; just defining what it does in the specific case of deleting the loop variable isn’t sufficient.
del VAR currently follows the same scoping rules as VAR = EXPR, so I think that a hypothetical (del VAR) expression could and should follow the same scoping rules as (VAR := EXPR).
del VAR essentially is an assignment, but of a "null pointer" instead of an object reference.