Well that almost applied to myself :)
> It actually raises "NameError: undefined local variable" today. But the
> Reference Manual, section 4.1 (Code blocks, execution frames, and name
> spaces) sez that a name is local to a block if and only if it's _bound_
> (anywhere) in the block, and explicitly says "a target occurring in a del
> statement does not bind a name". So the docs clearly say that "a" is
> global in f, while the implementation doesn't agree.
The rule is: The reference manual tries to describe the
implementation. It is less regularly updated and probably contains
many more bugs than the implementation. (Though sometimes attempting
to document the crooked ways of the implementation will prompt me to
fix the implementation :)
Corollary: I have to update the reference manual in this respect. I
agree 100% with all your points.
--Guido van Rossum, CWI, Amsterdam <Guido.van.Rossum@cwi.nl>
URL: <http://www.cwi.nl/cwi/people/Guido.van.Rossum.html>