Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder1.hal-mli.net!us.feeder.erje.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.datemas.de!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.049 X-Spam-Evidence: '*H*': 0.91; '*S*': 0.01; 'currently,': 0.09; 'from:addr:ethan': 0.09; 'from:addr:stoneleaf.us': 0.09; 'from:name:ethan furman': 0.09; 'message-id:@stoneleaf.us': 0.09; '~ethan~': 0.09; '"keep': 0.16; 'received:69.93': 0.16; 'subject:Case': 0.16; 'tempted': 0.16; 'wrote:': 0.18; 'example': 0.22; 'header:User-Agent:1': 0.23; 'switch': 0.26; 'header:In- Reply-To:1': 0.27; 'am,': 0.29; 'thus': 0.29; 'default,': 0.31; 'disable': 0.31; 'cases': 0.33; 'not.': 0.33; 'but': 0.35; 'there': 0.35; 'charset:us-ascii': 0.36; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'ian': 0.60; 'received:173': 0.61; 'back': 0.62; 'reply': 0.66; 'useful.': 0.68; 'day': 0.76; 'confusion.': 0.84; 'absolutely': 0.87; 'subject:Proposal': 0.91; 'lucas': 0.93 Date: Thu, 03 Apr 2014 11:23:39 -0700 From: Ethan Furman User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121010 Thunderbird/16.0.1 MIME-Version: 1.0 To: python-list@python.org Subject: Re: Yet Another Switch-Case Syntax Proposal References: <8084-1396540962-768613@sneakemail.com> In-Reply-To: <8084-1396540962-768613@sneakemail.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - gator3304.hostgator.com X-AntiAbuse: Original Domain - python.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - stoneleaf.us X-BWhitelist: no X-Source-IP: 173.12.184.233 X-Exim-ID: 1WVmJJ-0006WH-4E X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: ([173.12.184.233]) [173.12.184.233]:43547 X-Source-Auth: ethan+stoneleaf.us X-Email-Count: 2 X-Source-Cap: dG9idWs7dG9idWs7Z2F0b3IzMzA0Lmhvc3RnYXRvci5jb20= X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 23 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1396550862 news.xs4all.nl 2956 [2001:888:2000:d::a6]:59017 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:69604 On 04/03/2014 09:02 AM, Lucas Malor wrote: > > In reply to Ian Kelly: >> >> Instead of disabling fallthrough by default, why not disable it all together? > > I was tempted but there are cases in which it's useful. An example > > switch day casein ("Monday", "Thursday", "Wednesday", "Tuesday", "Friday"): > gotowork = True > continue > casein ("Monday", "Thursday", "Wednesday", "Tuesday", "Friday"): > daytype = "ferial" > casein ("Saturday", "Sunday") > daytype = "festive" Absolutely not. Currently, the 'continue' key word means "stop processing and go back to the beginning". You would have it mean "keep going forward". Thus 'continue' would mean both "go backwards" and "go forwards" and would lead to unnecessary confusion. -- ~Ethan~