[Python-ideas] except expression

Paul Moore p.f.moore at gmail.com
Wed Feb 19 12:31:52 CET 2014


On 19 February 2014 10:01, Steven D'Aprano <steve at pearwood.info> wrote:
> I don't think it needs a single word, especially since it's being
> deferred for later. I'm partial to describing it as "multiple except
> clauses", since that's exactly what it is.
>
> As far as I can tell, nobody refers to this as exception chaining:
>
> try: this
> except A: a
> except B: b
> except C: c
> ...
>
> Exception chaining is something very different, "raise A from B", and I
> think it is harmful for comprehension to have "exception chaining" and
> "chained excepts" mean radically different things.

Agreed the terminology should be clarified. In expression terms, a < b
< c is referred to as chained comparisons, so whichever way the term
"chaining" is used will be surprising to someone...

Paul


More information about the Python-ideas mailing list