[Python-ideas] except expression

Amber Yust amber.yust at gmail.com
Tue Feb 18 19:47:41 CET 2014


-1 to any proposal that a bare except in an expression should catch a
different set of exceptions than a bare except in a statement. That's
incredibly unintuitive.

On Tue Feb 18 2014 at 10:37:24 AM, Rob Cliffe <rob.cliffe at btinternet.com>
wrote:

>
> On 18/02/2014 16:56, Paul Moore wrote:
> > On 18 February 2014 16:43, Chris Angelico <rosuav at gmail.com> wrote:
> >>> OTOH, there's still an argument for only allowing a single exception
> >>> name in the syntax (an "identifier" rather than an "expression" in
> >>> syntax terms). If you must catch multiple exceptions, give the
> >>> relevant tuple a name.
> >> Hmm. Would that make anything any clearer? It feels like the sorts of
> >> crazy limitations that I've seen in some other languages, like how PHP
> >> up until relatively recently wouldn't let you subscript an array
> >> returned from a function without first assigning it to a variable:
> > Maybe not. Maybe again it's just a matter of a style recommendation.
> > But the PEP itself has to tread a fine line between showing what is
> > *possible* vs showing what is *intended* - I feel that the intention
> > of the except construct should *not* be to do most of the crazy things
> > people are talking about in this thread.
> Almost any language feature can be abused.  That doesn't mean we should
> regulate their use.
> Rob Cliffe
> >
> > Paul
> > _______________________________________________
> > Python-ideas mailing list
> > Python-ideas at python.org
> > https://mail.python.org/mailman/listinfo/python-ideas
> > Code of Conduct: http://python.org/psf/codeofconduct/
> >
> >
> > -----
> > No virus found in this message.
> > Checked by AVG - www.avg.com
> > Version: 2012.0.2247 / Virus Database: 3705/6602 - Release Date: 02/17/14
> >
> >
>
> _______________________________________________
> Python-ideas mailing list
> Python-ideas at python.org
> https://mail.python.org/mailman/listinfo/python-ideas
> Code of Conduct: http://python.org/psf/codeofconduct/
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-ideas/attachments/20140218/654802cd/attachment-0001.html>


More information about the Python-ideas mailing list