Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #105024
| Path | csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail |
|---|---|
| From | Antoon Pardon <antoon.pardon@rece.vub.ac.be> |
| Newsgroups | comp.lang.python |
| Subject | Re: Case Statements |
| Date | Wed, 16 Mar 2016 14:38:17 +0100 |
| Lines | 57 |
| Message-ID | <mailman.201.1458135495.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> |
| Mime-Version | 1.0 |
| Content-Type | text/plain; charset=utf-8 |
| Content-Transfer-Encoding | 7bit |
| X-Trace | news.uni-berlin.de vHCMGaPF77QlquhEGvrs3g+Z2HMQCEf0nLWBFFFKgBrQ== |
| Return-Path | <antoon.pardon@rece.vub.ac.be> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.006 |
| X-Spam-Evidence | '*H*': 0.99; '*S*': 0.00; 'received:134': 0.05; 'nasty': 0.07; 'get.': 0.09; 'statements': 0.09; 'bug': 0.10; 'python': 0.10; 'conditional': 0.16; 'constructs': 0.16; 'enough.': 0.16; 'expression.': 0.16; 'make,': 0.16; 'received:ac.be': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'scripts.': 0.16; 'simulate': 0.16; 'simulated': 0.16; 'switch.': 0.16; 'wrote:': 0.16; 'shell': 0.18; 'language': 0.19; '>>>': 0.20; 'developer': 0.20; 'otherwise,': 0.20; 'parsing': 0.22; 'header:In-Reply-To:1': 0.24; "i've": 0.25; 'header:User- Agent:1': 0.26; "doesn't": 0.26; 'developers': 0.26; 'command': 0.26; 'switch': 0.27; 'used,': 0.27; 'least': 0.27; 'for,': 0.29; 'hash': 0.29; 'unlikely': 0.29; 'raise': 0.29; 'e.g.': 0.30; 'putting': 0.30; 'received:be': 0.30; 'waste': 0.30; 'guess': 0.31; 'core': 0.32; 'table': 0.32; 'generally': 0.32; 'statement': 0.32; 'useful': 0.33; 'languages': 0.34; 'list': 0.34; 'gets': 0.35; 'done': 0.35; 'something': 0.35; 'item': 0.35; 'but': 0.36; 'should': 0.36; 'instead': 0.36; 'there': 0.36; 'to:addr:python- list': 0.36; 'subject:: ': 0.37; 'thought': 0.37; 'list.': 0.37; 'progress': 0.38; 'mailing': 0.38; 'enough': 0.39; 'to:addr:python.org': 0.40; 'where': 0.40; 'mark': 0.40; 'care': 0.60; 'hope': 0.61; 'different': 0.63; 'interest': 0.64; 'six': 0.65; 'soon': 0.65; '>>>>>': 0.66; 'bitten': 0.84; 'pardon': 0.84; 'schreef': 0.84; 'worthwhile.': 0.84; 'have.': 0.93 |
| X-IronPort-Anti-Spam-Filtered | true |
| X-IronPort-Anti-Spam-Result | At8LANpg6VaGuA9G/2dsb2JhbABehGEBvCSGDQKCCgEBAQEBAWWEaQEBBCNLChELGAICBRYLAgIJAwIBAgFFEwgCiCOvbItNhAgBAQgCHnyFIoREhQiCNIE6BZMEhE2BUIwxiSOFYo5/YoICGoFKi0wBAQE |
| User-Agent | Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.5.0 |
| In-Reply-To | <ncbeq6$vq$1@ger.gmane.org> |
| 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:105024 |
Show key headers only | View raw
Op 16-03-16 om 12:07 schreef Mark Lawrence: > On 16/03/2016 10:52, Antoon Pardon wrote: >> Op 16-03-16 om 10:51 schreef Mark Lawrence: >>> On 16/03/2016 09:35, Antoon Pardon wrote: >>>> Op 16-03-16 om 09:47 schreef Mark Lawrence: >>>>> >>>>>> >>>>>> Same with switch. You can use a hash table etc. to simulate >>>>>> switches, >>>>>> but only if the codeblocks are independent. Otherwise, if-elif >>>>>> chains >>>>>> are the way to go. Command line parsing is a case where switch >>>>>> statements are often used, e.g. in shell scripts. >>>>> >>>>> I've seen at least six different ways of simulating switches, so >>>>> those >>>>> people who want them, can have them. if-elif chains are not >>>>> likely to >>>>> kill any Python programmer. >>>>> >>>>> I have no interest what other languages use switch/case statements >>>>> for, as we've on the PYTHON mailing list. >>>> >>>> There once were multiple ways to simulate a conditional expression. >>>> And it was generally thought that using if else statements instead >>>> of a conditional expression was unlikely to kill any Python >>>> programmer. >>>> >>>> But then one of the core developers was bitten by a nasty bug because >>>> he was using one of those constructs that simulated a conditional >>>> expression and soon enough Python had a conditional expression. >>>> >>>> So I guess those who would like a case statement in Python can >>>> only hope a core developer gets bitten by a nasty bug while using >>>> one of those ways of simulating switches. >>>> >>> >>> So that core developers can waste their time putting something into >>> the language that we've done without for 25 years, yes, that strikes >>> me as extremely worthwhile. >> >> Do you think python should stop progressing? Because all progress >> python wil make, will be done by putting something in the language >> we've done without for 25 years. >> >> That we have done without doesn't contradict it can be useful to have. >> > > Raise the item on the python-ideas mailing list for the umpteenth time > then, and see how far you get. I don't care enough. I do care about people using valid arguments. -- Antoon Pardon
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll 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