[code-quality] W0602 global-variable-not-assigned
Jakub Wilk
jwilk at jwilk.net
Thu Apr 6 18:27:36 EDT 2017
* Josh Powers <josh.powers at canonical.com>, 2017-04-06, 14:30:
>I have code similar to [1] where instead of directly assigning a dictionary
>global variable the dictionary method update is used. Right now this results
>in a W0602 global-variable-not-assigned.
>
>Is this expected behavior and if so is there a better way to write the above?
Yes. The global statement only affects variable assignments. If you don't
assign to the variable, the global statement doesn't do anything and can be
removed.
--
Jakub Wilk
More information about the code-quality
mailing list