Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #8795 > unrolled thread

Re: Testing if a global is defined in a module

Started byTim Johnson <tim@johnsons-web.com>
First post2011-07-04 13:39 -0800
Last post2011-07-04 13:39 -0800
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Testing if a global is defined in a module Tim Johnson <tim@johnsons-web.com> - 2011-07-04 13:39 -0800

#8795 — Re: Testing if a global is defined in a module

FromTim Johnson <tim@johnsons-web.com>
Date2011-07-04 13:39 -0800
SubjectRe: Testing if a global is defined in a module
Message-ID<mailman.608.1309815451.1164.python-list@python.org>
* Chris Rebert <clp2@rebertia.com> [110704 13:16]:
> >
> > What else can I do here?
> 
> Look at the names in the module's import statements using the `ast`
> module, and exclude those from the set of names defined in the module.
> Won't work for `from foo import *`, but that's bad practice and should
> be refactored anyway.
  I'm completely new to the `ast' module, so I will have to research
  that one. 
  Thanks for the tip
-- 
Tim 
tim at johnsons-web dot com or akwebsoft dot com
http://www.akwebsoft.com

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web