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


Groups > comp.lang.python > #105080

Re: Case Statements

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Subject Re: Case Statements
Date Thu, 17 Mar 2016 20:55:33 +1100
Lines 17
Message-ID <mailman.266.1458208537.12893.python-list@python.org> (permalink)
References <f30500db-19cb-4de8-81f1-6eb77c28b3b4@googlegroups.com> <30502a2e-0bad-4b0f-a1e8-a2b40b0d7ab9@googlegroups.com> <mailman.181.1458102409.12893.python-list@python.org> <ncb4e0$op1$1@dont-email.me> <ncb6jk$rrm$1@ger.gmane.org> <56E928D4.3000701@rece.vub.ac.be> <ncbac2$qtk$1@ger.gmane.org> <56E93ADD.9040500@rece.vub.ac.be> <ncbeq6$vq$1@ger.gmane.org> <56E961C9.7040008@rece.vub.ac.be> <ncbp2b$ge6$3@ger.gmane.org> <56E97B60.3060402@rece.vub.ac.be> <ncc4tb$6kj$1@ger.gmane.org> <56E9A66E.4030905@rece.vub.ac.be> <mailman.253.1458170061.12893.python-list@python.org> <56e9f7f9$0$1597$c3e8da3$5496439d@news.astraweb.com> <mailman.254.1458174695.12893.python-list@python.org> <56ea0e4f$0$1585$c3e8da3$5496439d@news.astraweb.com> <CAPTjJmpxVUxEZ=YKA-gcXPf_JyoAbfLRFE0jN2fBNn9u-wMwaw@mail.gmail.com> <56EA778B.80109@rece.vub.ac.be>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
X-Trace news.uni-berlin.de o4WuknrXG9Ae/C5eJsVPxgoWZZLzfoxP1/nxquAV1w7w==
Return-Path <rosuav@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.014
X-Spam-Evidence '*H*': 0.97; '*S*': 0.00; 'received:209.85.223': 0.03; 'cc:addr:python-list': 0.09; 'global,': 0.09; 'python': 0.10; 'syntax': 0.13; 'interpreter': 0.15; 'thu,': 0.15; '2016': 0.16; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'simple.': 0.16; 'wrote:': 0.16; "wouldn't": 0.16; 'language': 0.19; '>>>': 0.20; 'cc:2**0': 0.20; 'cc:addr:python.org': 0.20; 'decorator': 0.22; 'either.': 0.22; 'tried': 0.24; 'header:In-Reply-To:1': 0.24; 'chris': 0.26; 'message-id:@mail.gmail.com': 0.27; "i'm": 0.30; 'classes': 0.30; 'work.': 0.30; "d'aprano": 0.33; 'steven': 0.33; 'though.': 0.33; 'received:google.com': 0.35; 'could': 0.35; 'but': 0.36; 'received:209.85': 0.36; 'depends': 0.36; 'pm,': 0.36; 'subject:: ': 0.37; 'things': 0.38; 'received:209': 0.38; 'mean': 0.38; 'sure': 0.39; 'does': 0.39; 'mar': 0.65; 'angelico:': 0.84; 'chrisa': 0.84; 'guarantee.': 0.84; 'messed': 0.84; 'pardon': 0.84; 'schreef': 0.84; 'to:none': 0.91; 'thing,': 0.93
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; bh=QLTZQDt0m9lGNyKZ3p4Brcc5inWXaatpPg/rkb4Wnwg=; b=nK7d0n2CrNL8bMmAt+O0bV/gqDIEaf8MHg8L9KLheAmcBdN/RsmKercqMW7VC1MwOP jOqoEXfCRSZX5sZ9xa1jW99boALl5XoQ6vZD44c/fCG4gBNKHiqdtVnYhkTptWEVuCUs F7QEeTZuRD6ZrkTSRD7zCNxUm6bEtGZHgwNU+vp0s3il4xG3FY7AGoYzgA7ebn3RpjkN PCFV+PgFYz0NiiaBUFL7YOpU+19oX6E2eG4JeT1u9dcKJ/qNKRt7aMV9+iKg0zJa65La TjvD0JpanxIFtpWhV3qYLqxmHTHRs1meLEm5IxeH2KwMl9KEuwrMIkSBzs7/QYhspeeQ Za5g==
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:date :message-id:subject:from:cc; bh=QLTZQDt0m9lGNyKZ3p4Brcc5inWXaatpPg/rkb4Wnwg=; b=b+21n+wrpUpwcvm1qpXSjfOZBjOvPqsPpzxzsijFkS+6H7yaTATh77vzsJ5YLGAE1r 9CCEAMy4HwtnVfFvyawmVpS1DoAAWtz34HCH09AbVZ3uVuzmQmBGEixUQw1qb0K6O6vK YuKe8ryjGvtQL2BQAR1cYd48QwHgCKGcOFLRZLCUzjUpexxRpOAisLNFmCJg8cejW9Mf j6DsEMdUdBodJ84haB2ZDEeww5Er55Vcxv4qpvmVgnAW4x9YDp9LXQG0nConKjPenMqp dPKVhtYUhJ0UG5W9wF3T1HVUrZ2fi14lfw+jryCKpaPdLqT5VexVsVW0WXW3LN3VbKiV zi5A==
X-Gm-Message-State AD7BkJK/09AuHQGkB+IqC53vF/fP62iGzfLl0JNVJXSmDwDpog/66JqEWm67UnAVdZZ65aw9NasGLw43BaxOkg==
X-Received by 10.107.128.104 with SMTP id b101mr8319098iod.31.1458208534225; Thu, 17 Mar 2016 02:55:34 -0700 (PDT)
In-Reply-To <56EA778B.80109@rece.vub.ac.be>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.21
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>
Xref csiph.com comp.lang.python:105080

Show key headers only | View raw


On Thu, Mar 17, 2016 at 8:23 PM, Antoon Pardon
<antoon.pardon@rece.vub.ac.be> wrote:
> Op 17-03-16 om 03:02 schreef Chris Angelico:
>> On Thu, Mar 17, 2016 at 12:54 PM, Steven D'Aprano <steve@pearwood.info> wrote:
>>
>>> I wouldn't want to rely on it working with decorator syntax either. Even if
>>> it does now, I'm not sure that's a language guarantee.
>> That's the thing, though. It's not a guarantee, yet it does work in
>> every Python interpreter that I tried it in.
>
> That depends on what you mean by work. This failes:
> [doing the same thing in a function]

Very true; I could have messed around with getframe, but most classes
are global, and it keeps things simple.

ChrisA

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


Thread

Case Statements jj0gen0info@gmail.com - 2016-03-15 13:46 -0700
  Re: Case Statements Mark Lawrence <breamoreboy@yahoo.co.uk> - 2016-03-15 23:11 +0000
  Re: Case Statements jj0gen0info@gmail.com - 2016-03-15 16:47 -0700
    Re: Case Statements Mark Lawrence <breamoreboy@yahoo.co.uk> - 2016-03-15 23:58 +0000
    Re: Case Statements BartC <bc@freeuk.com> - 2016-03-16 00:51 +0000
      Re: Case Statements Mark Lawrence <breamoreboy@yahoo.co.uk> - 2016-03-16 01:05 +0000
  Re: Case Statements jj0gen0info@gmail.com - 2016-03-15 18:55 -0700
    Re: Case Statements "Mario R. Osorio" <nimbiotics@gmail.com> - 2016-03-15 21:06 -0700
      Re: Case Statements BartC <bc@freeuk.com> - 2016-03-16 10:34 +0000
        Re: Case Statements Steven D'Aprano <steve@pearwood.info> - 2016-03-16 23:56 +1100
    Re: Case Statements Mark Lawrence <breamoreboy@yahoo.co.uk> - 2016-03-16 04:26 +0000
      Re: Case Statements Christian Gollwitzer <auriocus@gmx.de> - 2016-03-16 09:13 +0100
        Re: Case Statements Mark Lawrence <breamoreboy@yahoo.co.uk> - 2016-03-16 08:47 +0000
        Re: Case Statements Marko Rauhamaa <marko@pacujo.net> - 2016-03-16 11:16 +0200
        Re: Case Statements Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2016-03-16 10:35 +0100
        Re: Case Statements Mark Lawrence <breamoreboy@yahoo.co.uk> - 2016-03-16 09:51 +0000
          Re: Case Statements BartC <bc@freeuk.com> - 2016-03-16 19:41 +0000
            Re: Case Statements BartC <bc@freeuk.com> - 2016-03-16 22:30 +0000
        Re: Case Statements Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2016-03-16 11:52 +0100
        Re: Case Statements Mark Lawrence <breamoreboy@yahoo.co.uk> - 2016-03-16 11:07 +0000
          Re: Case Statements BartC <bc@freeuk.com> - 2016-03-16 11:16 +0000
            Re: Case Statements Mark Lawrence <breamoreboy@yahoo.co.uk> - 2016-03-16 11:33 +0000
            Re: Case Statements Marko Rauhamaa <marko@pacujo.net> - 2016-03-16 14:21 +0200
              Re: Case Statements BartC <bc@freeuk.com> - 2016-03-16 12:53 +0000
                Re: Case Statements Marko Rauhamaa <marko@pacujo.net> - 2016-03-16 16:31 +0200
                Re: Case Statements BartC <bc@freeuk.com> - 2016-03-16 15:00 +0000
                Re: Case Statements Marko Rauhamaa <marko@pacujo.net> - 2016-03-16 19:07 +0200
              Re: Case Statements Rustom Mody <rustompmody@gmail.com> - 2016-03-20 01:01 -0700
                Re: Case Statements Mark Lawrence <breamoreboy@yahoo.co.uk> - 2016-03-20 08:29 +0000
        Re: Case Statements Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2016-03-16 14:38 +0100
        Re: Case Statements Mark Lawrence <breamoreboy@yahoo.co.uk> - 2016-03-16 14:02 +0000
        Re: Case Statements Marko Rauhamaa <marko@pacujo.net> - 2016-03-16 21:27 +0200
          Re: Case Statements Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2016-03-17 09:22 +0100
            Re: Case Statements Marko Rauhamaa <marko@pacujo.net> - 2016-03-17 10:57 +0200
              Re: Case Statements Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2016-03-17 10:12 +0100
        Re: Case Statements Steven D'Aprano <steve@pearwood.info> - 2016-03-17 11:19 +1100
          Re: Case Statements Steven D'Aprano <steve@pearwood.info> - 2016-03-17 12:54 +1100
            Re: Case Statements Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2016-03-17 18:45 +1300
              Re: Case Statements Chris Angelico <rosuav@gmail.com> - 2016-03-17 17:30 +1100
                Re: Case Statements Gregory Ewing <greg.ewing@canterbury.ac.nz> - 2016-03-18 18:59 +1300
              Re: Case Statements Steven D'Aprano <steve+comp.lang.python@pearwood.info> - 2016-03-17 17:29 +1100
                Re: Case Statements Chris Angelico <rosuav@gmail.com> - 2016-03-17 17:48 +1100
                Re: Case Statements Steven D'Aprano <steve@pearwood.info> - 2016-03-17 21:53 +1100
                Re: Case Statements Chris Angelico <rosuav@gmail.com> - 2016-03-17 22:49 +1100
            Re: Case Statements Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2016-03-17 10:23 +0100
            Re: Case Statements Chris Angelico <rosuav@gmail.com> - 2016-03-17 20:55 +1100
          Re: Case Statements Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2016-03-17 09:36 +0100
        Re: Case Statements Antoon Pardon <antoon.pardon@rece.vub.ac.be> - 2016-03-17 09:38 +0100
  Re: Case Statements l0r0m0a0i0l@gmail.com - 2016-03-16 06:15 -0700
    Re: Case Statements Steven D'Aprano <steve@pearwood.info> - 2016-03-17 00:27 +1100
      Re: Case Statements Mark Lawrence <breamoreboy@yahoo.co.uk> - 2016-03-16 14:00 +0000
    Re: Case Statements Mark Lawrence <breamoreboy@yahoo.co.uk> - 2016-03-16 13:59 +0000
  Re: Case Statements l0r0m0a0i0l@gmail.com - 2016-03-16 07:21 -0700
    Re: Case Statements Marko Rauhamaa <marko@pacujo.net> - 2016-03-16 16:33 +0200

csiph-web