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


Groups > comp.lang.python > #79099

Re: Short syntax for try/pass

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!fdn.fr!usenet-fr.net!nerim.net!novso.com!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.002
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'syntax': 0.04; 'pep': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'elsewhere,': 0.16; 'feasible': 0.16; 'indexerror:': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'subject:pass': 0.16; 'url:peps': 0.16; 'wrote:': 0.18; 'example': 0.22; 'otherwise,': 0.22; 'this?': 0.23; 'header:User-Agent:1': 0.23; 'case.': 0.24; 'propose': 0.24; 'url:dev': 0.24; 'pass': 0.26; 'subject:/': 0.26; 'header:X-Complaints-To:1': 0.27; 'header :In-Reply-To:1': 0.27; 'am,': 0.29; "i'm": 0.30; 'url:python': 0.33; 'could': 0.34; 'url:org': 0.36; 'to:addr:python-list': 0.38; 'short': 0.38; 'sure': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'such': 0.63; 'became': 0.64; 'subject:try': 0.84
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Ned Batchelder <ned@nedbatchelder.com>
Subject Re: Short syntax for try/pass
Date Tue, 14 Oct 2014 10:28:11 -0400
References <CAEhE+OknxQs0XdENq_MR=HyER1qz5_JXXRHxO35RYV3h-K13KQ@mail.gmail.com>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host 18.189.16.44
User-Agent Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:24.0) Gecko/20100101 Thunderbird/24.6.0
In-Reply-To <CAEhE+OknxQs0XdENq_MR=HyER1qz5_JXXRHxO35RYV3h-K13KQ@mail.gmail.com>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
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>
Newsgroups comp.lang.python
Message-ID <mailman.14851.1413296906.18130.python-list@python.org> (permalink)
Lines 24
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1413296906 news.xs4all.nl 2936 [2001:888:2000:d::a6]:45933
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:79099

Show key headers only | View raw


On 10/14/14 10:08 AM, Leonardo Giordani wrote:
> Would it be feasible to propose a short syntax like this?
>
> pass SomeException:
>    somecode
>
> where the above example would become:
>
> pass IndexError:
>   lst[0] = lst[0] + 1
>
> I could not find if such a syntax has been already discussed elsewhere,
> so please let me know if this is the case.
>
> Otherwise, what do you think about it?

PEP 463 proposes a short syntax for this use case: 
http://legacy.python.org/dev/peps/pep-0463/

I'm not sure what became of it.

-- 
Ned Batchelder, http://nedbatchelder.com

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


Thread

Re: Short syntax for try/pass Ned Batchelder <ned@nedbatchelder.com> - 2014-10-14 10:28 -0400

csiph-web