[code-quality] W0602 global-variable-not-assigned

Marc 'BlackJack' Rintsch marc at rintsch.de
Thu Apr 6 18:47:12 EDT 2017


On 06/04/17 23:30, Josh Powers wrote:
> Hi,
> 
> 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 it is expected (IMHO) and the way to avoid this warning is to remove
the unnecessary ``global`` declaration.  You don't assign a value to the
name, so don't declare it as ``global``.

Ciao,
	Marc 'BlackJack' Rintsch
-- 
“Fools ignore complexity.  Pragmatists suffer it.
 Some can avoid it.  Geniuses remove it.”
                                -- Alan J. Perlis

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
URL: <http://mail.python.org/pipermail/code-quality/attachments/20170407/945b9e07/attachment.sig>


More information about the code-quality mailing list