Pattern: Global variable not defined in the module scope
Issue: -
Used when a variable is defined through the global
statement but the variable is not defined in the module scope.
Example of incorrect code:
def define_constant():
global SOMEVAR
SOMEVAR = 2
Example of correct code:
SOMEVAR = 1
def fix_contant(value):
SOMEVAR = value