Conditional based on whether or not a module is being used

A

Aahz

Excellent, this is what I finally discovered, although I was looking
for 'foo' in sys.modules.keys(), which apparently isn't necessary.

Actually, `foo in sys.modules.keys()` is double-slow, because first the
dict must be scanned to create a list, and then the list must be scanned
linearly to test for foo.
--
Aahz ([email protected]) <*> http://www.pythoncraft.com/

"Many customs in this life persist because they ease friction and promote
productivity as a result of universal agreement, and whether they are
precisely the optimal choices is much less important." --Henry Spencer
 
A

Aahz

I'm reviewing the documentation at the moment, as it happens, and it
still seems hard to be able to put together a structure which is good
for everyone. A full treatment, it seems to me, would talk a little
about the detail of why things work as they do; but a lot of the time,
people are just interested in getting going with the package, and less
interested in the whys and wherefores. But for people trying to do more
than the basics, that deeper understanding is sometimes necessary. The
hard part is satisfying all audiences in one document!

Simple answer: don't

The main logging docs should be reference material, but the top of the
docs should link to a tutorial (or the other way around, but I think the
Python docs have generally preferred to make the primary doc reference).

Trying to make one page serve all documentation purposes rarely works.
--
Aahz ([email protected]) <*> http://www.pythoncraft.com/

"Many customs in this life persist because they ease friction and promote
productivity as a result of universal agreement, and whether they are
precisely the optimal choices is much less important." --Henry Spencer
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,774
Messages
2,569,596
Members
45,132
Latest member
TeresaWcq1
Top