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


Groups > comp.lang.python > #69382

Re: checking if two things do not equal None

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.002
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'subject:not': 0.03; 'explicit': 0.07; 'odd': 0.07; 'subject:two': 0.07; 'subject:None': 0.09; 'cc:addr:python-list': 0.11; '"is': 0.16; 'background,': 0.16; 'chained': 0.16; 'finney': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'it;': 0.16; 'means.': 0.16; 'side.': 0.16; 'variables,': 0.16; 'language': 0.16; 'wrote:': 0.18; 'variable': 0.18; 'bit': 0.19; 'value.': 0.19; 'seems': 0.21; 'cc:addr:python.org': 0.22; 'mathematical': 0.24; 'question': 0.24; 'cc:2**0': 0.24; "i've": 0.25; 'possibly': 0.26; 'asking': 0.27; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; "doesn't": 0.30; 'message- id:@mail.gmail.com': 0.30; 'usually': 0.31; '(usually': 0.31; 'are.': 0.31; 'constant': 0.31; 'writes:': 0.31; 'sense': 0.34; 'maybe': 0.34; 'problem': 0.35; "can't": 0.35; 'something': 0.35; 'but': 0.35; 'received:google.com': 0.35; 'done': 0.36; 'two': 0.37; 'ben': 0.38; 'pm,': 0.38; 'explain': 0.39; 'does': 0.39; 'either': 0.39; 'more': 0.64; '30,': 0.65; 'within': 0.65; 'between': 0.67; 'mar': 0.68; 'line,': 0.68; 'nobody': 0.68; 'min': 0.84; 'to:none': 0.92
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type:content-transfer-encoding; bh=EzQuztP/CVA+KkRRuiXnU8YcIR+t+MuDCg0kgKtFIwI=; b=YAhqdiNspuiDKuSI9KxrQZonQxrts4LP+wxICOHfALoRHUvGNzzx2A0R9D6ukTtRhi AJqWbwpr47BEdEkKgJxbnJrHBu625IFGgqqb5rbW3cY7+GNQENdAkXFlNNi51QqwCLJX ku+cWdbLaMPtPGfJSpJdpPhYzxhJnpx38P0BQKmR13o5fltWtfBwV/OFZhpTNDlmJBcx qmSu4u3wWmsrW6J8iQMgnOHVgcEnQwZu2yZIimeBT2f7hUswhyPefm+OGNlyo+89Guic MudZVquVbXpYawxbjpBvQU7KXrSpVd8YQ3KV6REjBDzOy3hPfM63XA27NucfYFcIM1XA 16FA==
MIME-Version 1.0
X-Received by 10.68.197.8 with SMTP id iq8mr323540pbc.124.1396165009556; Sun, 30 Mar 2014 00:36:49 -0700 (PDT)
In-Reply-To <85wqfcmb54.fsf@benfinney.id.au>
References <0245aca0-c6b7-493a-aa52-2c3ef6462dbd@googlegroups.com> <5337195f$0$29994$c3e8da3$5496439d@news.astraweb.com> <lh7cb4$ntu$2@news.albasani.net> <roy-B5E8CC.17072029032014@news.panix.com> <53377b9e$0$29994$c3e8da3$5496439d@news.astraweb.com> <mailman.8709.1396145720.18130.python-list@python.org> <5337b182$0$29994$c3e8da3$5496439d@news.astraweb.com> <CAPTjJmqRP=xcDd18pvBb5brSm8k4h_Vu_7-=u6YCCMCYN3vXUw@mail.gmail.com> <85wqfcmb54.fsf@benfinney.id.au>
Date Sun, 30 Mar 2014 18:36:49 +1100
Subject Re: checking if two things do not equal None
From Chris Angelico <rosuav@gmail.com>
Cc "python-list@python.org" <python-list@python.org>
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding quoted-printable
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://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 <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.8715.1396165018.18130.python-list@python.org> (permalink)
Lines 25
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1396165018 news.xs4all.nl 2899 [2001:888:2000:d::a6]:59028
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:69382

Show key headers only | View raw


On Sun, Mar 30, 2014 at 5:52 PM, Ben Finney <ben+python@benfinney.id.au> wrote:
> Chris Angelico <rosuav@gmail.com> writes:
>
>> The problem isn't that I can't see what the comparisons are. It makes
>> very good sense to bound a variable within constants; but you already
>> know exactly where 2 is on the number line, so asking "Is 2 between
>> these two variables" seems a bit odd. Maybe it's less so with the
>> strong mathematical background, but it seems odd to me.
>
> I don't feel odd about asking the question “Is 2 between these two
> values?”. It's straightforward and concise. Can you explain better why
> you find it odd?

Possibly because the "variable between two constants" is something
I've done often (usually in the more explicit form of "x > min && x <
max" in a language without chained comparisons), usually
bounds-checking some value. I've never had to ask whether a single
constant has two variables, one on either side. But that's just that
I've personally never done it; it doesn't mean nobody does it, by any
means.

ChrisA

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


Thread

checking if two things do not equal None contact.trigon@gmail.com - 2014-03-29 11:56 -0700
  Re: checking if two things do not equal None Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-03-29 19:05 +0000
    Re: checking if two things do not equal None contact.trigon@gmail.com - 2014-03-29 12:23 -0700
    Re: checking if two things do not equal None Lele Gaifax <lele@metapensiero.it> - 2014-03-29 20:24 +0100
    Re: checking if two things do not equal None Johannes Bauer <dfnsonfsduifb@gmx.de> - 2014-03-29 22:01 +0100
      Re: checking if two things do not equal None Roy Smith <roy@panix.com> - 2014-03-29 17:07 -0400
        Re: checking if two things do not equal None Johannes Bauer <dfnsonfsduifb@gmx.de> - 2014-03-29 22:55 +0100
          Re: checking if two things do not equal None Johannes Bauer <dfnsonfsduifb@gmx.de> - 2014-03-29 23:02 +0100
        Re: checking if two things do not equal None Dave Angel <davea@davea.name> - 2014-03-29 18:01 -0400
          Re: checking if two things do not equal None contact.trigon@gmail.com - 2014-03-29 16:20 -0700
        Re: checking if two things do not equal None Tim Chase <python.list@tim.thechases.com> - 2014-03-29 17:36 -0500
          Re: checking if two things do not equal None Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-03-30 02:24 +0000
            Re: checking if two things do not equal None Roy Smith <roy@panix.com> - 2014-03-29 22:43 -0400
              Re: checking if two things do not equal None Zachary Ware <zachary.ware+pylist@gmail.com> - 2014-03-29 22:04 -0500
        Re: checking if two things do not equal None Roy Smith <roy@panix.com> - 2014-03-29 18:41 -0400
        Re: checking if two things do not equal None Tim Chase <tim@thechases.com> - 2014-03-29 17:46 -0500
          Re: checking if two things do not equal None Roy Smith <roy@panix.com> - 2014-03-29 18:51 -0400
        Re: checking if two things do not equal None Chris Angelico <rosuav@gmail.com> - 2014-03-30 10:17 +1100
        Re: checking if two things do not equal None Tim Chase <python.list@tim.thechases.com> - 2014-03-29 20:19 -0500
        Re: checking if two things do not equal None Chris Angelico <rosuav@gmail.com> - 2014-03-30 12:37 +1100
        Re: checking if two things do not equal None Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-03-30 02:04 +0000
          Re: checking if two things do not equal None Chris Angelico <rosuav@gmail.com> - 2014-03-30 13:15 +1100
            Re: checking if two things do not equal None Roy Smith <roy@panix.com> - 2014-03-29 22:39 -0400
              Re: checking if two things do not equal None Rustom Mody <rustompmody@gmail.com> - 2014-03-29 19:54 -0700
                Re: checking if two things do not equal None Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-03-30 06:08 +0000
                Re: checking if two things do not equal None Roy Smith <roy@panix.com> - 2014-03-30 08:21 -0400
                Re: checking if two things do not equal None MRAB <python@mrabarnett.plus.com> - 2014-03-30 14:58 +0100
                Re: checking if two things do not equal None Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2014-03-31 11:48 +1300
              Re: checking if two things do not equal None Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2014-03-30 19:41 +1300
                Re: checking if two things do not equal None Marko Rauhamaa <marko@pacujo.net> - 2014-03-30 10:37 +0300
            Re: checking if two things do not equal None Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2014-03-30 05:54 +0000
              Re: checking if two things do not equal None Chris Angelico <rosuav@gmail.com> - 2014-03-30 17:17 +1100
              Re: checking if two things do not equal None Ben Finney <ben+python@benfinney.id.au> - 2014-03-30 17:52 +1100
              Re: checking if two things do not equal None Chris Angelico <rosuav@gmail.com> - 2014-03-30 18:36 +1100
      Re: checking if two things do not equal None Ethan Furman <ethan@stoneleaf.us> - 2014-03-29 16:20 -0700
  Re: checking if two things do not equal None Terry Reedy <tjreedy@udel.edu> - 2014-03-29 19:02 -0400
  Re: checking if two things do not equal None Jeremy Sanders <jeremy@jeremysanders.net> - 2014-03-31 09:56 +0200
    Re: checking if two things do not equal None Abe <contact.trigon@gmail.com> - 2014-03-31 10:28 -0700
      Re: checking if two things do not equal None Moritz Emanuel Beber <moritz.beber@gmail.com> - 2014-03-31 21:22 +0200

csiph-web