Pattern: Unnecessary global
statement at module level
Issue: -
Using global
makes sense only within nested scopes of a given module. It has no effect if used at the module level.
Example of incorrect code:
global name
name = "test"
def func():
global name
Example of correct code:
def func():
global name
name = "test"