[issue17792] Unhelpful UnboundLocalError due to del'ing of exception target

Barry A. Warsaw report at bugs.python.org
Fri Apr 19 03:03:24 CEST 2013


Barry A. Warsaw added the comment:

On Apr 19, 2013, at 12:37 AM, R. David Murray wrote:

>And what if it weren't a print statement?  An error is better than a
>"randomly" changed value, I think.  I'm really not sure there is anything we
>can do here, beyond Ezio's warning suggestion.

Right.  The point is, is it more helpful to have an unexpected value in the
local (e.g. None, which in fact may not be *totally* unexpected) or an
mystical exception? ;)

A warning would be fine.  I just want to give programmers some help in trying
to figure out why their code is wrong.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue17792>
_______________________________________


More information about the Python-bugs-list mailing list