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


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

Re: suppressing import errors

Started byChris Angelico <rosuav@gmail.com>
First post2011-11-16 07:01 +1100
Last post2011-11-16 07:01 +1100
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: suppressing import errors Chris Angelico <rosuav@gmail.com> - 2011-11-16 07:01 +1100

#15736 — Re: suppressing import errors

FromChris Angelico <rosuav@gmail.com>
Date2011-11-16 07:01 +1100
SubjectRe: suppressing import errors
Message-ID<mailman.2746.1321387303.27778.python-list@python.org>
On Wed, Nov 16, 2011 at 6:39 AM, David Riley <fraveydank@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

[toc] | [standalone]


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


csiph-web