4aafc96 pylint3: workaround false positives reported for W1662

4 files Authored by abbra 5 years ago, Committed by rcritten 5 years ago,
    pylint3: workaround false positives reported for W1662
    
    Pylint3 falsely reports warning W1662: using a variable that was bound
    inside a comprehension for the cases where the same name is reused for a
    loop after the comprehension in question.
    
    Rename the variable in a loop to avoid it.
    
    If the code looks like the following:
    
      arr = [f for f in filters if callable(f)]
      for f in arr:
          result = result + f()
    
    pylint3 would consider 'f' used outside of comprehension. Clearly, this
    is a false-positive warning as the second 'f' use is completely
    independent of the comprehension's use of 'f'.
    
    Reviewed-By: Aleksei Slaikovskii <aslaikov@redhat.com>
    (cherry picked from commit c61151f6aa0c033834aed70561fc762c06176555)
    
    Reviewed-By: Rob Crittenden <rcritten@redhat.com>
    
        
file modified
+2 -2
file modified
+1 -1
file modified
+1 -1
file modified
+1 -1