Aug. 5, 2015
2:48 p.m.
Steven D'Aprano added the comment: I wonder if it is a left-over from the behaviour prior to 3.2? In 3.1, I get this syntax error: py> def outer(): ... spam = 1 ... def inner(): ... nonlocal spam ... del spam ... inner() ... SyntaxError: can not delete variable 'spam' referenced in nested scope See also the "Changed in 3.2" comment here: https://docs.python.org/3/reference/simple_stmts.html#the-del-statement ---------- nosy: +steven.daprano _______________________________________ Python tracker <report@bugs.python.org> <http://bugs.python.org/issue24796> _______________________________________