You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@register_suggestion_for(NameError, re.VARREFBEFOREASSIGN_RE)
def suggest_local_var_ref_before_assign(value, frame, groups):
"""Get the suggestions for local var reference before assign."""
del value # unused param
name, = groups
objs = get_objects_in_frame(frame).get(name, [])
for obj, scope in objs:
# TODO_ENCLOSING: suggest 'nonlocal'
if scope == 'global':
return
yield quote('global ' + name)
Got add different error message
NameError: free variable 'title' referenced before assignment in enclosing scope
$ python --version
Python 3.2.3
The text was updated successfully, but these errors were encountered: