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


Groups > comp.lang.python > #79099 > unrolled thread

Re: Short syntax for try/pass

Started byNed Batchelder <ned@nedbatchelder.com>
First post2014-10-14 10:28 -0400
Last post2014-10-14 10:28 -0400
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

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

#79099 — Re: Short syntax for try/pass

FromNed Batchelder <ned@nedbatchelder.com>
Date2014-10-14 10:28 -0400
SubjectRe: Short syntax for try/pass
Message-ID<mailman.14851.1413296906.18130.python-list@python.org>
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

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web