[Python-projects] Another E1101 false positive

Daniel Drake ddrake at brontes3d.com
Fri Dec 22 16:07:54 CET 2006


This is certainly bad coding practice (defining a variable with the same
name as an import) but pylint is misinterpreting what happens here.

FileA.py:

	def funcA():
	    return 4

FileB.py:

	import FileA
	FileA = [1,2,3]
	print FileA.funcA()


Run pylint on FileB:

	E1101:  6: Instance of 'list' has no 'funcA' member

However, run FileB through python:

	4


In other words: when a variable is named the same as an import, python
uses the import, but pylint interprets the code as if it is using the
variable.

Daniel




More information about the Python-Projects mailing list