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

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
code-quality mailing list
code-quality@python.org
https://mail.python.org/mailman/listinfo/code-quality

Reply via email to