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


Groups > comp.lang.python > #111733

Re: Stupid question, just need a quick and dirty fix

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Subject Re: Stupid question, just need a quick and dirty fix
Date Fri, 22 Jul 2016 14:28:37 +1000
Lines 17
Message-ID <mailman.39.1469161719.22221.python-list@python.org> (permalink)
References <e1a10af3-cd57-4a56-98bf-7a9ed8b3d999@googlegroups.com> <CAPTjJmo__i+zZyk+kFe-f8JZy6UYKawPPR_NqXAdfseK4zqJLQ@mail.gmail.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
X-Trace news.uni-berlin.de kSkiO8rbvW7xTTMVlr3hKQ7lO0d/cP4hNbMz2gGIhggQ==
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.003
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'see.': 0.07; 'subject:question': 0.08; 'cc:addr:python-list': 0.09; '22,': 0.09; 'defined.': 0.09; 'lost.': 0.09; '2016': 0.16; '24,': 0.16; 'assignment.': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'wrote:': 0.16; 'subject:need': 0.18; 'tree': 0.18; 'variable': 0.18; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'code.': 0.23; 'errors': 0.23; 'this:': 0.23; 'header:In-Reply-To:1': 0.24; 'fri,': 0.27; 'message-id:@mail.gmail.com': 0.27; 'indentation': 0.29; 'referenced': 0.29; "i'm": 0.30; 'work.': 0.30; '15,': 0.30; "i'd": 0.31; 'post': 0.31; "can't": 0.32; 'problem': 0.33; 'received:google.com': 0.35; 'something': 0.35; 'but': 0.36; 'possible': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; '12,': 0.37; 'desired': 0.37; 'your': 0.60; 'matter': 0.63; 'jul': 0.72; 'bayless': 0.84; 'chrisa': 0.84; 'to:none': 0.91
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:cc; bh=y7Zuj0PvEp3Jqb5fBGrEfPkF7gKaAs2AR8Atb0PSIOc=; b=DtVMxWdbkmPUBTCIEIjz/duVH0dvujJcwtH1AwoPAyZ9mBeFKnVFekCZ8slnlMbqy5 bcd6WOIeFXweQA66yYsUCgIFm64Em6CyBY041vIzQp64bfX4eLhO7KMrHrR+Ggs0UWF1 ifGJtXsrryvnNoUu5brmoxdnWN1D2YxM1na4MKY17N9lRS2tqPhQYILnQ42k8xet7hAQ RyeCOkWwOvNGrV7rZ1oIJ7JNubD2cJna3Le5JcMuG3Lo/pP7mkjMC92OzLm0tJ/B59yq C8ZX2gb8ZdZiB8OWJvQRqizMqE11WjIi4yzvTx0/mY92PqFZsxOewOeKr+NRUOvqzGv0 1uDA==
X-Google-DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:cc; bh=y7Zuj0PvEp3Jqb5fBGrEfPkF7gKaAs2AR8Atb0PSIOc=; b=V0+YzxhFJ7H/ibvzN3zoV9lYV/gAkfPMyWRqLCbu66MJ79N8/llcjZsBa6j5dRea56 8xdb/RiL7p9IxlnmQyulKihn5YPTvVihFYQhSGadqL294oHbefu2ZoY/CzHDqx9Yy7qI iP5uynUf09nlANF8EyEF9MLqAmRznH57MD1hn1V1HMre5TmlyfNUfJH8/MIviW95Wtw+ zRMBXM1njKgKyqlzdUqx/IjZbO1AMtBn6hv7E+cAolH/3FgGGD0GBsqvqh9MrNDlwjd9 BJ93A7enww4Iovlcp09XzyTwtiC72RBeedaf68KjOEaOwngairbOy2hq342+V0yVyE4z +uzQ==
X-Gm-Message-State AEkoouuy0idwWjrMFxRbpOHg7AjratvX3BIMruO9PA/RYKH7tga0CdurNqhzDArJlGkT6APvrrp+cu5HpoXU5Q==
X-Received by 10.28.1.23 with SMTP id 23mr2664505wmb.22.1469161718477; Thu, 21 Jul 2016 21:28:38 -0700 (PDT)
In-Reply-To <e1a10af3-cd57-4a56-98bf-7a9ed8b3d999@googlegroups.com>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.22
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>
X-Mailman-Original-Message-ID <CAPTjJmo__i+zZyk+kFe-f8JZy6UYKawPPR_NqXAdfseK4zqJLQ@mail.gmail.com>
X-Mailman-Original-References <e1a10af3-cd57-4a56-98bf-7a9ed8b3d999@googlegroups.com>
Xref csiph.com comp.lang.python:111733

Show key headers only | View raw


On Fri, Jul 22, 2016 at 2:19 PM, Jordan Bayless <jmbayless@gmail.com> wrote:
> I get various errors no matter what I do to this to try and make it work. Variable not defined. Referenced before assignment. etc etc. I'm lost. How do I make it work?

It might be easier if you post all your code. To be honest, what I'd
be looking at is something like this:

good_ids = {
    12, 15, 24,
    ...  # fill in all of these
}
desired = id < 10 or id > 133 or id in good_ids

But it's possible your problem has nothing to do with your massive
'if' tree and everything to do with indentation or other problems we
can't see.

ChrisA

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


Thread

Stupid question, just need a quick and dirty fix Jordan Bayless <jmbayless@gmail.com> - 2016-07-21 21:19 -0700
  Re: Stupid question, just need a quick and dirty fix Chris Angelico <rosuav@gmail.com> - 2016-07-22 14:28 +1000
    Re: Stupid question, just need a quick and dirty fix Jordan Bayless <jmbayless@gmail.com> - 2016-07-21 21:39 -0700
      Re: Stupid question, just need a quick and dirty fix Chris Angelico <rosuav@gmail.com> - 2016-07-22 14:45 +1000
        Re: Stupid question, just need a quick and dirty fix Jordan Bayless <jmbayless@gmail.com> - 2016-07-21 22:26 -0700
          Re: Stupid question, just need a quick and dirty fix Paul Rubin <no.email@nospam.invalid> - 2016-07-21 23:03 -0700
          Re: Stupid question, just need a quick and dirty fix Chris Angelico <rosuav@gmail.com> - 2016-07-22 16:34 +1000
          Re: Stupid question, just need a quick and dirty fix Steven D'Aprano <steve@pearwood.info> - 2016-07-22 16:37 +1000
            Re: Stupid question, just need a quick and dirty fix thilfigr16@gmail.com - 2016-07-22 06:00 -0700
          Re: Stupid question, just need a quick and dirty fix Cousin Stanley <cousinstanley@gmail.com> - 2016-07-22 08:45 -0700
      Re: Stupid question, just need a quick and dirty fix Michael Selik <michael.selik@gmail.com> - 2016-07-22 01:18 -0400
        Re: Stupid question, just need a quick and dirty fix Steven D'Aprano <steve@pearwood.info> - 2016-07-22 16:08 +1000
          Re: Stupid question, just need a quick and dirty fix Michael Selik <michael.selik@gmail.com> - 2016-07-22 18:53 +0000
  Re: Stupid question, just need a quick and dirty fix MRAB <python@mrabarnett.plus.com> - 2016-07-22 15:58 +0100

csiph-web