New submission from zipher: >>> num = 1 >>> def t1(): print num >>> t1() 1 >>> def t2(): ... num+=1 ... print num >>> t2() UnboundLocalError: local variable 'num' referenced before assignment
It seems num is bound in t1, but not t2, even though they are the same scope. Am I missing something? ---------- components: Interpreter Core messages: 167928 nosy: Mark.Janssen priority: normal severity: normal status: open title: UnboundLocalError on simple in-place assignment of an inner scope versions: Python 2.7 _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue15621> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com