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


Groups > comp.lang.python > #15744

Re: suppressing import errors

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <ian.g.kelly@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.047
X-Spam-Evidence '*H*': 0.91; '*S*': 0.00; '"if': 0.04; 'correct.': 0.09; 'none.': 0.09; 'none"': 0.16; 'subject:import': 0.16; 'wrote:': 0.18; 'header:In-Reply-To:1': 0.23; 'message- id:@mail.gmail.com': 0.29; 'received:209.85.214': 0.30; 'received :mail-bw0-f46.google.com': 0.30; 'nov': 0.31; 'pm,': 0.31; 'tue,': 0.32; 'to:addr:python-list': 0.32; 'probably': 0.34; 'something': 0.36; 'received:google.com': 0.38; 'received:209.85': 0.38; 'either': 0.39; "it's": 0.39; 'subject:: ': 0.39; 'to:addr:python.org': 0.39; 'received:209': 0.40; '2011': 0.62; 'here.': 0.66; 'idiomatic': 0.84
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=3s5CvFo2NY2xPBRqqNtV78ti3deIsQP5p7wZ9y13PlM=; b=CXlWw52liaBVJaD2E9MQqXAdSZYO/ke7M5vTU8ASSQqgth+RnnNiRwKWN4UTJmH+vu WqUxcqkdvhdg+jnfLBtOYDNiSvtwVUTN3rv+G8a/HVhRbyxXSp1LZ1PD9raQ7Gk7pi20 CBLFmLXzyWC4MzynjbhQZ3Cea0hu+T2oekvJo=
MIME-Version 1.0
In-Reply-To <CAJ6cK1ZDAnWRH2GDWHFaLFvanx1Ga6n5=Cb79jX4oPNpeO52rQ@mail.gmail.com>
References <CAC82khmG+zH3Cd5pRfou+0FED18MHfizLzJL4EM+V+Pw+q17+w@mail.gmail.com> <CALvWhxvc=Ng28YeiL0Onv9YCixfQtOqgLENWJqYgoRSYvo_juA@mail.gmail.com> <CAC82khn3WBjXY7podVq6RX0d0j38w1vbtN3fNOCSGLcu2X_jOw@mail.gmail.com> <D97140E4-9B09-4EAE-BB92-0F038FCDBA5A@gmail.com> <4EC2B656.7050902@sequans.com> <0601B8C7-9AEF-443A-A149-0F7D356345EF@gmail.com> <CAPTjJmrP7fMg9UfxdsR=5j6EW4yFKf8gR4xYQD5zDwMUVxdmjw@mail.gmail.com> <F8266E63-F932-4216-9E33-8333C1D62E43@gmail.com> <CAPTjJmofCYDy5rLPzCJPNMj5qM_KAc9606RmLKAtcaySjwf92w@mail.gmail.com> <CAJ6cK1ZDAnWRH2GDWHFaLFvanx1Ga6n5=Cb79jX4oPNpeO52rQ@mail.gmail.com>
From Ian Kelly <ian.g.kelly@gmail.com>
Date Tue, 15 Nov 2011 15:09:31 -0700
Subject Re: suppressing import errors
To Python <python-list@python.org>
Content-Type text/plain; charset=ISO-8859-1
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2753.1321395004.27778.python-list@python.org> (permalink)
Lines 6
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1321395004 news.xs4all.nl 6937 [2001:888:2000:d::a6]:47584
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:15744

Show key headers only | View raw


On Tue, Nov 15, 2011 at 2:42 PM, Arnaud Delobelle <arnodel@gmail.com> wrote:
> It's idiomatic to write "x is None" when you want to know whether x is None.

It's also idiomatic to just write "if x:" when you want to know
whether x is something or nothing, and that's what I would probably do
here.  Either is correct.

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: suppressing import errors Ian Kelly <ian.g.kelly@gmail.com> - 2011-11-15 15:09 -0700

csiph-web