[Python-ideas] except expression

Chris Angelico rosuav at gmail.com
Wed Feb 19 08:06:05 CET 2014


On Wed, Feb 19, 2014 at 5:10 PM, Chris Angelico <rosuav at gmail.com> wrote:
> Once again, there are a good number of try/except blocks that match
> these fairly restrictive rules - around 300. (THIS! IS! PYTHON!) And
> once again, they overwhelmingly *do not* use the 'as' clause.

Despite the numbers saying that 'as' is almost completely unnecessary
to the proposal, I'm leaving it in for the moment, pending more data.
However, I'm removing two parts of the proposal: bare except clauses
(use "except BaseException:" if you really want that) and chaining of
excepts (use parens, "(expr except Exception1: default1) except
Exception2: default2").

Current PEP draft:

https://raw2.github.com/Rosuav/ExceptExpr/master/pep-0463.txt

ChrisA


More information about the Python-ideas mailing list