Irit Katriel <iritkatr...@yahoo.com> added the comment:
I think the issue is that the error message for UnboundLocalError is wrong, see this example: >>> def g(): ... x = 42 ... del x ... print(x) ... >>> g() Traceback (most recent call last): File "<stdin>", line 1, in <module> File "<stdin>", line 4, in g UnboundLocalError: local variable 'x' referenced before assignment >>> How about we change it to "local variable 'x' referenced before assignment or after deletion"? ---------- components: +Interpreter Core nosy: +iritkatriel versions: +Python 3.10 -Python 3.4 _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue17792> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com