Mark Syms <mark.s...@citrix.com> writes:

> E: 13,16: Non-iterable value nullfh is used in an iterating context 
> (not-an-iterable)

Bear in mind that PyLint performs static analysis; it doesn't execute
the code, and so does not have access to the Python objects that running
statements produce.

Since Python objects are dynamically typed, a static analysis cannot be
certain of the type of any object.

> However the code is functional so nullfh does work in the iterating
> context.

I expect PyLint makes an incorrect guess about the type of the return
value from ‘tempfile.TemporaryFile()’.

-- 
 \       “You can never entirely stop being what you once were. That's |
  `\   why it's important to be the right person today, and not put it |
_o__)                                 off until tomorrow.” —Larry Wall |
Ben Finney

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

Reply via email to