namespace and reloading (was Re: PythonWin IDE sucks!)

Michael Hudson mwh21 at cam.ac.uk
Thu Nov 2 19:27:00 EST 2000


hzhu at users.sourceforge.net (Huaiyu Zhu) writes:

> I think that once you do "from module import *" there's no way to find out
> which name in your current name space came from which module.  (Somebody
> please confirm this as I'm not completely sure.)

No, that's right.  With function objects you can do:

>>> f.func_code.co_filename 
'/home/mwh21/src/python/basic.py'

but that doesn't necessarily tell you where the module you're
interested in got the name from...

Cheers,
M.

-- 
34. The string  is a stark data  structure and  everywhere it is 
    passed there is much duplication of process. It is a perfect 
    vehicle for hiding information.
  -- Alan Perlis, http://www.cs.yale.edu/homes/perlis-alan/quotes.html



More information about the Python-list mailing list