Jon added the comment:
Sorry, I think I just misread this section. I was confused by the fact that
del binds names like assignment does, so that the following tries to delete a
local name and fails:
x = 1
def f():
del x
f()
In fact the documentation does say that there must be
R. David Murray added the comment:
I don't understand, what do you think is missing from the description? It
certainly talks about name binding. Also, can you provide a link to the other
statement, as I can't find it, and out of context I have no idea what it is
talking about.
--
New submission from Jon:
The documentation for the del keyword in the language reference doesn't mention
the name binding behaviour:
https://docs.python.org/3/reference/simple_stmts.html#grammar-token-del_stmt
It is mentioned in section 4.1 where it says:
A target occurring in a del