diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/user_guide/checkers/features.rst | 5 | ||||
-rw-r--r-- | doc/whatsnew/fragments/5073.other | 3 |
2 files changed, 6 insertions, 2 deletions
diff --git a/doc/user_guide/checkers/features.rst b/doc/user_guide/checkers/features.rst index 1ebf5ca53..579f7f987 100644 --- a/doc/user_guide/checkers/features.rst +++ b/doc/user_guide/checkers/features.rst @@ -1363,8 +1363,9 @@ Variables checker Messages :unused-variable (W0612): *Unused variable %r* Used when a variable is defined but not used. :global-variable-not-assigned (W0602): *Using global for %r but no assignment is done* - Used when a variable is defined through the "global" statement but no - assignment to this variable 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. :undefined-loop-variable (W0631): *Using possibly undefined loop variable %r* Used when a loop variable (i.e. defined by a for loop or a list comprehension or a generator expression) is used outside the loop. diff --git a/doc/whatsnew/fragments/5073.other b/doc/whatsnew/fragments/5073.other new file mode 100644 index 000000000..610bda9fb --- /dev/null +++ b/doc/whatsnew/fragments/5073.other @@ -0,0 +1,3 @@ +Update explanation for ``global-variable-not-assigned`` and add confidence. + +Closes #5073 |