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:45:58 +1000 Lines: 10 Message-ID: References: <881b184c-11e4-41e7-a01e-6a21d454ce68@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de mN9sdio7SF4fWbVo9w9emA0+RqGQ78Md9NQpjm/7tCLA== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.005 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'anyway.': 0.04; 'elif': 0.04; 'subject:question': 0.08; 'cc:addr:python-list': 0.09; '22,': 0.09; 'statements': 0.09; 'pushed': 0.13; '2016': 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; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'latter': 0.22; 'simpler': 0.22; 'seems': 0.23; 'header:In-Reply- To:1': 0.24; 'fri,': 0.27; 'message-id:@mail.gmail.com': 0.27; 'equality': 0.29; 'faster,': 0.29; 'other,': 0.29; "i'm": 0.30; 'statement': 0.32; 'membership': 0.34; 'previous': 0.34; 'received:google.com': 0.35; "isn't": 0.35; 'pm,': 0.36; 'subject:: ': 0.37; 'doing': 0.38; 'rather': 0.39; 'series': 0.65; 'statement,': 0.66; 'jul': 0.72; 'bayless': 0.84; 'chrisa': 0.84; 'to:none': 0.91; 'checks.': 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=04QSY6odoBgIQacuzg5PMMr90KxM+BZT0Uh+xLJ6AGQ=; b=bTR4ICDnFsX34VThkCDTcHi2qIQnb5LO138ezqLOPiZ6301Uyoo5fImOs9HRfgDyZs Pn7W8RrN7krgGinGgXAtp4HMd87apINyktTHetU46wTfv+TWVdDZz6/0dyiStyqqZMSx cHCOlOqoB55JPcn4Ew1w1tKjwQIBa/B36sWjPumPK3zyzqwwRWRmzUH9a69BFz9lMSBB D+l0uBIcFvVCKOYTeGtKkaojmx4tUsgmr2zNDeC6Ewp7GlEs0+fpnq8T7N7NwOfhcAfP Uwy1+os2rVvDji8EfdIfh2fPunPdDFVoMYL7FQNEK6Jtor8z8djxU/Y5cG9sso+GeKFq wXyg== 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=04QSY6odoBgIQacuzg5PMMr90KxM+BZT0Uh+xLJ6AGQ=; b=WP2NpWZoZKPd9guQ7eC53KobEu3AnJ7TtRfZtiEiYUfQsoi7zGOVDb/tUQRpm1zrRL mB7f7fBIM7eZCjvg74jTkmuje66JBGrusLJqWOeqsku7XJ8hMfzcogMSjT9PnPcc/lZR r3uAd83IHXJGGQddZN7Wig6Xbj8nfnGpruAqYg1E+UVUV+T2NC4lOqFg+RVf96YhaGa3 wlR6uwgmyby5vFhgBN7ClT9WY74/RnBttIPN1qN4S6s2WzIXZz0PUsAPRQzX8vousN9Y dnJ2TQIe6W4p3iKxlH3ZvFvHv7FAkRlcJP9kOqfVdgBZbRuSNjA2aeuOMsG6yrJaGIO3 CasQ== X-Gm-Message-State: AEkoous7dDTT+CbuPElLr2EJ/4ULyN/L2dXqFt35I+JbiExhVOsJMjXdoEc4c1ddQj7zcF4MbPuu7OtYYHcJ7g== X-Received: by 10.28.17.138 with SMTP id 132mr2548522wmr.81.1469162759202; Thu, 21 Jul 2016 21:45:59 -0700 (PDT) In-Reply-To: <881b184c-11e4-41e7-a01e-6a21d454ce68@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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Mailman-Original-Message-ID: X-Mailman-Original-References: <881b184c-11e4-41e7-a01e-6a21d454ce68@googlegroups.com> Xref: csiph.com comp.lang.python:111735 On Fri, Jul 22, 2016 at 2:39 PM, Jordan Bayless wrote: > it seems there's a) no case statement (WTF?) and b) I'm limited to how many elif statements I can use. The latter isn't true; and you're not using elif anyway. With no case statement, you get pushed to other, better ways of doing things, like the much simpler way I showed in my previous email - it uses set membership rather than a series of individual equality checks. Faster, cleaner, much easier to work with. ChrisA