[Python-Dev] scope-collapse
Guido van Rossum
gvanrossum at gmail.com
Wed Apr 27 02:18:48 CEST 2005
[Jim jewett]
> The pretend-it-is-a-generator proposals try to specify that only
> certain names will be shared, in only certain ways.
Huh? I don't see it this way. There is *no* sharing between the frame
of the generator and the frame of the block. The block is a permanent
part of the frame surrounding the with-statement, so all names are
shared there.
> > Would make more sense if the collapse keyword was at the module level.
>
> ??? Are you suggesting that everything defined in the module must live
> in a single namespace, just because the collapse was wanted in one place?
No, I was just proposing putting 'collapse foo' in the module, which
would mean that (a) the definition of foo is intended to be a macro,
and (b) all uses of foo are intended to call that macro.
But I still think this whole proposal is built on quicksand, so don't
take that suggestion too seriously.
--
--Guido van Rossum (home page: http://www.python.org/~guido/)
More information about the Python-Dev
mailing list