Re: Conflict between docs & behavior (was Re: Another newbee question)
Wed, 13 Apr 1994 09:43:17 +0200

> [those not fascinated by the subtleties of name resolution should
> feel free to skip this!
> ]

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 <>
URL: <>