Re: [Python-Dev] PEP 463: Exception-catching expressions

2014年2月21日 09:35:33 -0800

On 2014年2月22日 02:52:59 +1100
Chris Angelico <[email protected]> wrote:
> On Sat, Feb 22, 2014 at 1:34 AM, Brett Cannon <[email protected]> wrote:
> > While I like the general concept, I agree that it looks too much like a
> > crunched statement; the use of the colon is a non-starter for me. I'm sure
> > I'm not the only one whose brain has been trained to view a colon in Python
> > to mean "statement", period. This goes against that syntactic practice and
> > just doesn't work for me.
> >
> > I'm -1 with the current syntax, but it can go into the + range if a better
> > syntax can be chosen.
> 
> We bikeshedded that extensively on -ideas. The four best options are:
> 
> value = (expr except Exception: default)
-0.5
> value = (expr except Exception -> default)
-0.5
> value = (expr except Exception pass default)
-1 (looks terribly weird)
> value = (expr except Exception then default)
+0.5
But I'm aware it requires reserving "then" as a keyword, which might
need a prior SyntaxWarning.
Regards
Antoine.
_______________________________________________
Python-Dev mailing list
[email protected]
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to