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


Groups > comp.lang.python > #111735

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:45:58 +1000
Lines 10
Message-ID <mailman.40.1469162766.22221.python-list@python.org> (permalink)
References <e1a10af3-cd57-4a56-98bf-7a9ed8b3d999@googlegroups.com> <CAPTjJmo__i+zZyk+kFe-f8JZy6UYKawPPR_NqXAdfseK4zqJLQ@mail.gmail.com> <mailman.39.1469161719.22221.python-list@python.org> <881b184c-11e4-41e7-a01e-6a21d454ce68@googlegroups.com> <CAPTjJmrqnbobzhzGuiLtdUVgTAnP4togkDqOW3M7pgdnECJFug@mail.gmail.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
X-Trace news.uni-berlin.de mN9sdio7SF4fWbVo9w9emA0+RqGQ78Md9NQpjm/7tCLA==
Return-Path <rosuav@gmail.com>
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 <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 <CAPTjJmrqnbobzhzGuiLtdUVgTAnP4togkDqOW3M7pgdnECJFug@mail.gmail.com>
X-Mailman-Original-References <e1a10af3-cd57-4a56-98bf-7a9ed8b3d999@googlegroups.com> <CAPTjJmo__i+zZyk+kFe-f8JZy6UYKawPPR_NqXAdfseK4zqJLQ@mail.gmail.com> <mailman.39.1469161719.22221.python-list@python.org> <881b184c-11e4-41e7-a01e-6a21d454ce68@googlegroups.com>
Xref csiph.com comp.lang.python:111735

Show key headers only | View raw


On Fri, Jul 22, 2016 at 2:39 PM, Jordan Bayless <jmbayless@gmail.com> 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

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