Testing if a global is defined in a module

Tim Johnson tim at johnsons-web.com
Tue Jul 5 01:26:47 CEST 2011

* Steven D'Aprano <steve+comp.lang.python at pearwood.info> [110704 15:18]:
> You are mistaken. TestAddresses is *not* a member of an imported module. It
> is a member of the current module, which may or may not happen to point to
> the same object as the other module as well.
 You are correct. I mispoke or misapplied. See my last post.
> >    'usingCgi' is the only data variable defined in <targetmodule>
> It seems to me that your approach here is unnecessarily complex and fragile.
> I don't know what problem you are trying to solve, but trying to solve it
> by intraspecting differences that aren't differences is surely the wrong
> way to do it.
  See my last post...
tim at johnsons-web dot com or akwebsoft dot com

More information about the Python-list mailing list