[Python-ideas] except expression
Greg Ewing
greg.ewing at canterbury.ac.nz
Sun Feb 16 00:28:28 CET 2014
Philipp A. wrote:
> hmm i still don’t like the colon. everywhere else in python, it means
> “new block follows”
No, it doesn't. There are at least two existing exceptions,
lambdas and slice expressions.
> and i’m sure nobody here wants to allow the following?
>
> |value = hovercraft() except EelsException:
> remove_eels()
> no_eels #this is assigned to “value” if we have too many eels
>
> neither should we introduce a colon that /can’t/ be followed by a block.
I don't think anyone is suggesting that. The colons in lambdas
and slice expressions can't be followed by blocks either,
and nobody seems to have difficulty with that.
--
Greg
More information about the Python-ideas
mailing list