Hello,
I found a false negative with pylint.
The following code (iterable.py) is not recognized as incorrect:
----------------------
class A(object):
pass
a = A()
xs = []
xs.extend(a)
----------------------
Python execution results in
Traceback (most recent call last):
File "iterable.py", line 6, in <module>
xs.extend(a)
TypeError: 'A' object is not iterable
Pylint says:
************* Module iterable
C: 1: Missing docstring
C: 1:A: Invalid name "A" (should match [A-Z_][a-zA-Z0-9]+$)
C: 1:A: Missing docstring
R: 1:A: Too few public methods (0/2)
pylint 0.18.1,
astng 0.19.1, common 0.45.1
Python 2.5.4 (r254:67916, Nov 30 2009, 21:04:24)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-44)]
I have also tried with a newer pylint. Unfortunately, I do not have the precise output any more, but
also that version does not report an error, only warnings and recommendations.
pylint 0.20.0,
astng 0.20.0, common 0.49.0
Python 2.6.4 (r264:75706, Jun 4 2010, 18:20:31)
GCC 4.4.4 20100503 (Red Hat 4.4.4-2)]
The tickets of the pylint project do not seem to have this error; #20464 and #9891 mention the same
error, but those happen inside pylint or one of its libraries. Here the error is in the program
under test.
Albert
_______________________________________________
Python-Projects mailing list
[email protected]
http://lists.logilab.org/mailman/listinfo/python-projects