Re: Catching an exception in a variable

2017-08-04 Thread Steve D'Aprano
On Fri, 4 Aug 2017 06:21 pm, Ben Finney wrote about the unbinding of exception variable on leaving the except block: > I think this is a terrible idea. I agree it is a terrible idea. I'd go so far as to say it is the worst possible way for dealing with the program of exception reference loops, e

Re: Catching an exception in a variable

2017-08-04 Thread ast
"Ben Finney" a écrit dans le message de news:[email protected]... "ast" writes: Ok, ty -- https://mail.python.org/mailman/listinfo/python-list

Re: Catching an exception in a variable

2017-08-04 Thread Ben Finney
"ast" writes: > Why variable ex doesn't exist ? Because of a deliberate decision made to delete it. Silently. This is documented: When an exception has been assigned using as target, it is cleared at the end of the except clause. This is as if except E as N: foo