[issue28606] Suspected bug in python optimizer with decorators

2016-11-03 Thread R. David Murray
R. David Murray added the comment: The statement in question causes the compiler to make 'tags' a local variable in the function, and thus you get the error on the assignment. See https://docs.python.org/3/faq/programming.html#id8. -- nosy: +r.david.murray resolution: -> not a bug st

[issue28606] Suspected bug in python optimizer with decorators

2016-11-03 Thread Brian Smith
New submission from Brian Smith: While using decorators in python 3.5.2, I ran into a surprising bug where the decorator sometimes lost context of the outer scope. The attached file demonstrates this problem. In this file, we have 2 decorators. They are identical, except that the first has