[Python-ideas] Implied try blocks

anatoly techtonik techtonik at gmail.com
Mon Mar 26 12:59:47 CEST 2012


On Sun, Mar 25, 2012 at 5:15 PM, Calvin Spealman <ironfroggy at gmail.com> wrote:
>
> r = some_single_statement()
> except TypeError:
>    print "oh no!"
>    raise OhNoException()
> else:
>    p = prepare(r)
>    print "I got", p

-1, because.. When I reading this and encounter "except TypeError", I
have to update the code that I've already read (the stuff in my head)
to place it into exception handling block. That's a good anti-pattern
for readability.

--
anatoly t.



More information about the Python-ideas mailing list