suppressing import errors

Chris Angelico rosuav at gmail.com
Tue Nov 15 15:01:40 EST 2011


On Wed, Nov 16, 2011 at 6:39 AM, David Riley <fraveydank at gmail.com> wrote:
> True, and that does avoid polluting namespace.  However, you shouldn't be testing for None as a bool; you should instead do an "if <module> is None:" (or, of course, "is not None").

Why not? Is there some other way for the module object to evaluate as false?

ChrisA



More information about the Python-list mailing list