Text of codeql.github.com › codeql-query-help › python › py-redundant-global-declaration as Styx crawled it on Nov 19, 2026. The page may have changed since. Only its words are kept, without pictures or layout.

Open the live page

Use of ‘global’ at module level — CodeQL query help documentation

CodeQL query help documentation » CodeQL query help for Python » Use of ‘global’ at module level ¶ ID: py/redundant-global-declaration Kind: problem Security severity: Severity: warning Precision: very-high Tags: - quality - maintainability - useless-code Query suites: - python-code-quality.qls - python-security-and-quality.qls Click to see the query in the CodeQL repository The global statement is used to specify that assignments to that name are assignments to the variable in the global (module) scope, rather than in the local scope.

At the module level, this statement is redundant because the local scope and global scope are the same. Recommendation ¶ Remove the global statement. References ¶ Python Language Reference: The global statement . © GitHub, Inc. Terms Privacy