title: Is there a python syntax checker that can ignore ' assigned to but never used' when locals() is present?
body: <p>suppose I have the code</p>
  
  <pre><code>def foo():
      bar = 1
      wibble = 3
      return locals()
  </code></pre>
  
  <p>my current syntax checker (flake8 with syntastic.vim) will throw a 'assigned to but never used' error on both variables. However locals() implies something is they are in fact being used, if not explicitly.</p>
  
  <pre><code>def foo():
      bar = 1
      wibble = 3 # &lt;-- I still want this to throw as it is definitely not being used
      return bar
  </code></pre>
  
  <p>Is there any python checker or custom setting that will be locals() aware and lenient? </p>
  
  <p>EDIT: </p>
  
  <p>This is a quick and dirty solution for vim/syntastic/flake8 that will suppress the warning in your .vimrc</p>
  
  <pre><code>"Ignore unused variable warnings whenever locals() is being used in a file                                                              
  function! LocalsWarningSuppress()                                              
      if ( search("locals()",'nw') &gt; 0)                                          
          let g:syntastic_python_checker='flake8 --ignore=W806'                  
      else                                                                       
          let g:syntastic_python_checker='flake8'                                
      endif                                                                      
  endfunction 
  
  au BufWritePre **/(filter_pattern)*py call LocalsWarningSuppress()                 
  </code></pre>