Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #8795
| Date | 2011-07-04 13:39 -0800 |
|---|---|
| From | Tim Johnson <tim@johnsons-web.com> |
| Subject | Re: Testing if a global is defined in a module |
| References | <20110704181133.GH1971@johnsons-web.com> <CAMZYqRSk-dbnpesh6uMYNZ3bDSs9=hTtjQ8fzsn1x-bhQ_=dAg@mail.gmail.com> |
| Organization | AkWebsoft |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.608.1309815451.1164.python-list@python.org> (permalink) |
* 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
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: Testing if a global is defined in a module Tim Johnson <tim@johnsons-web.com> - 2011-07-04 13:39 -0800
csiph-web