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


Groups > comp.lang.python > #79099

Re: Short syntax for try/pass

From Ned Batchelder <ned@nedbatchelder.com>
Subject Re: Short syntax for try/pass
Date 2014-10-14 10:28 -0400
References <CAEhE+OknxQs0XdENq_MR=HyER1qz5_JXXRHxO35RYV3h-K13KQ@mail.gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.14851.1413296906.18130.python-list@python.org> (permalink)

Show all headers | 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