global-variable-not-assigned / W0602#
Using global for %r but no assignment is done
When a variable defined in the global scope is modified in an inner scope, the 'global' keyword is required in the inner scope only if there is an assignment operation done in the inner scope.
TOMATO = "black cherry" def update_tomato(): global TOMATO # [global-variable-not-assigned] print(TOMATO)
TOMATO = "black cherry" def update_tomato(): global TOMATO TOMATO = "moneymaker"
Created by the variables checker.