Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.016 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; '"if': 0.04; 'not?': 0.09; 'am,': 0.12; '16,': 0.15; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'namespace.': 0.16; 'subject:import': 0.16; 'wed,': 0.17; 'wrote:': 0.18; 'received:209.85.213.46': 0.23; 'received:mail- yw0-f46.google.com': 0.23; "shouldn't": 0.23; 'header:In-Reply- To:1': 0.23; 'testing': 0.24; 'true,': 0.28; 'message- id:@mail.gmail.com': 0.29; 'module': 0.30; 'nov': 0.31; 'does': 0.32; 'to:addr:python-list': 0.32; 'instead': 0.33; 'there': 0.33; 'david': 0.34; 'object': 0.35; 'none': 0.36; 'received:google.com': 0.38; 'some': 0.38; 'received:209.85': 0.38; 'should': 0.39; 'why': 0.39; 'subject:: ': 0.39; 'to:addr:python.org': 0.39; 'received:209': 0.40; '2011': 0.62; 'evaluate': 0.71; 'riley': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; bh=K4DNvygZl5eC3J+6ZK7n+WxqLFlzRhHbc0lLxFxB6I8=; b=JEdboUtq72QhrLobQStSJ6gu5FBvufyHsr0jQCpBvvw7ej8L0Xf+iV3L2pbmXY5hXP nfIwSlq7E29Xz2FtAjf2n2r0aon7Ozwlh44QcBdOW5bhdBK7Td23u5uAsm8yPVSwSQIt DwfKhSaIw8EkB6C8xPhOs7yYDob3UZEMGcOQI= MIME-Version: 1.0 In-Reply-To: <0601B8C7-9AEF-443A-A149-0F7D356345EF@gmail.com> References: <4EC2B656.7050902@sequans.com> <0601B8C7-9AEF-443A-A149-0F7D356345EF@gmail.com> Date: Wed, 16 Nov 2011 07:01:40 +1100 Subject: Re: suppressing import errors From: Chris Angelico To: python-list@python.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 9 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1321387303 news.xs4all.nl 6987 [2001:888:2000:d::a6]:58868 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:15736 On Wed, Nov 16, 2011 at 6:39 AM, David Riley wrote: > True, and that does avoid polluting namespace. =A0However, you shouldn't = be testing for None as a bool; you should instead do an "if is Non= e:" (or, of course, "is not None"). Why not? Is there some other way for the module object to evaluate as false= ? ChrisA