Hi,

the following code does not work until I ommit the "a=0" statement.


   def test():
       exec "a=3" in locals()
       print a
       a=0

    test()

print raises:
     UnboundLocalError: local variable 'a' referenced before
assignment

Can anybody explain what is going wrong here ?

Greetings, Uwe
--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to