[issue29593] Improve UnboundLocalError message for deleted names

Matthias Bussonnier report at bugs.python.org
Fri Feb 17 15:37:35 EST 2017


Matthias Bussonnier added the comment:

> makes the error message longer

Out of curiosity is there a guide as to what is considered a too long error message ?

Or is there a technical reason like after a certain length strings are not cached and exception will be slower to construct ? I'm trying to understand why rhettinger would have proposed in his talk to make this specific error message longer and there is a push back now. 

> and since "del" is rarely used for deleting local variables I afraid that it can add confusion in most cases.

> The "del" statement is not the only way to unset the local variable.

Good point, would "or has been unset" be acceptable ?

----------

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


More information about the Python-bugs-list mailing list