[Python-3000] Draft PEP for outer scopes

Jan Grant jan.grant at bristol.ac.uk
Thu Nov 2 17:46:06 CET 2006


On Thu, 2 Nov 2006, Georg Brandl wrote:

> > PS. If you're hunting for keywords to overload to drag variables into scope, 
> > "import" is also available, although would probably be very hard to make 
> > work.
> 
> How should that possibly work?

Without treading on the toes of the existing import syntax, god knows 
(which is what I meant by "very hard").

The docs claim import exists to "(2) define a name or names in the local 
namespace (of the scope where the import statement occurs)" but since 
outer variable names may shadow module names,

	def f():
	 import x

couldn't be used :-(



-- 
jan grant, ISYS, University of Bristol. http://www.bris.ac.uk/
Tel +44 (0)117 3317661   http://ioctl.org/jan/
We thought time travel was impossible. But that was now and this is then.


More information about the Python-3000 mailing list