Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #15743
| Path | csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!gegeweb.org!de-l.enfer-du-nord.net!feeder2.enfer-du-nord.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <arnodel@gmail.com> |
| 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; 'defaults': 0.07; 'compares': 0.09; 'am,': 0.12; '16,': 0.15; 'argument': 0.15; 'cc:addr:python-list': 0.15; 'boolean': 0.16; 'compact': 0.16; 'none"': 0.16; 'quicker': 0.16; 'subject:import': 0.16; 'received:74.125.82.44': 0.17; 'received:mail-ww0-f44.google.com': 0.17; 'wed,': 0.17; 'wrote:': 0.18; 'cc:no real name:2**0': 0.21; 'header:In-Reply-To:1': 0.23; 'testing': 0.24; 'variable': 0.24; 'cc:2**0': 0.25; 'cc:addr:python.org': 0.29; 'message- id:@mail.gmail.com': 0.29; 'equality': 0.30; 'chris': 0.30; 'nov': 0.31; 'value.': 0.32; 'done': 0.33; 'probably': 0.34; 'david': 0.34; 'none': 0.36; 'received:74.125.82': 0.37; 'two': 0.37; 'could': 0.38; 'received:google.com': 0.38; 'some': 0.38; 'e.g.': 0.38; 'received:74.125': 0.39; 'should': 0.39; "it's": 0.39; 'subject:: ': 0.39; 'might': 0.39; 'really': 0.40; 'more': 0.60; '2011': 0.62; 'skip:\xc2 10': 0.73; 'hand,': 0.76; 'beware': 0.84; 'container)': 0.84; 'idiomatic': 0.84; '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 :cc:content-type:content-transfer-encoding; bh=/DtcgKW7+FTbAAJzymb3stZyIfKkyOBZ5sNPj2MRhjY=; b=sXz23WNVUcRFL++v2eo4zleivPF5Ajr8gG5jv4Qe1d3orLsfeUPdp17pLFzAxsEjBm RqlMBIZUJRiFx/+WF157dpL/Ob5zcU6+OCxTx2sqh2r/k8OK9yDiC00a1+HzjfjAIDLq PPpM8KTcFtflLrnTRdjFb9zYWs8CExJVy8mo8= |
| MIME-Version | 1.0 |
| In-Reply-To | <CAPTjJmofCYDy5rLPzCJPNMj5qM_KAc9606RmLKAtcaySjwf92w@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> |
| Date | Tue, 15 Nov 2011 21:42:22 +0000 |
| Subject | Re: suppressing import errors |
| From | Arnaud Delobelle <arnodel@gmail.com> |
| To | Chris Angelico <rosuav@gmail.com> |
| Content-Type | text/plain; charset=UTF-8 |
| Content-Transfer-Encoding | quoted-printable |
| Cc | python-list@python.org |
| 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.2752.1321393344.27778.python-list@python.org> (permalink) |
| Lines | 27 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1321393344 news.xs4all.nl 6951 [2001:888:2000:d::a6]:58930 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | x330-a1.tempe.blueboxinc.net comp.lang.python:15743 |
Show key headers only | View raw
On 15 November 2011 21:34, Chris Angelico <rosuav@gmail.com> wrote: > On Wed, Nov 16, 2011 at 8:20 AM, David Riley <fraveydank@gmail.com> wrote: >> Comparisons to singletons like None should always be done with >> 'is' or 'is not', never the equality operators. >> >> Also, beware of writing "if x" when you really mean "if x is not None" >> -- e.g. when testing whether a variable or argument that defaults to >> None was set to some other value. The other value might have a type >> (such as a container) that could be false in a boolean context! > > It's probably quicker to execute "if x is None" than "if x" > (presumably the former just compares the two pointers). On the other > hand, it's more compact to leave off the "is None". And on the > gripping hand, neither "quicker to execute" nor "more compact" equates > to "more Pythonic". It's idiomatic to write "x is None" when you want to know whether x is None. -- Arnaud
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: suppressing import errors Arnaud Delobelle <arnodel@gmail.com> - 2011-11-15 21:42 +0000
csiph-web