Path: csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail From: Chris Angelico 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: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de kSkiO8rbvW7xTTMVlr3hKQ7lO0d/cP4hNbMz2gGIhggQ== Return-Path: 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: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: Xref: csiph.com comp.lang.python:111733 On Fri, Jul 22, 2016 at 2:19 PM, Jordan Bayless 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