False positive for E1101 on function member 'func_name'
![](https://secure.gravatar.com/avatar/3b823d14198a94781b7c8b812639e7b4.jpg?s=120&d=mm&r=g)
Hi again, I am using pylint 1.1.0 for Python 2.6 code. The following code: def myfunc(): print myfunc.func_name # Incorrectly raises E1101 print myfunc.__name__ # Correctly passes causes this pylint error to be raised: E1101: Function 'myfunc' has no 'func_name' member Python supports the func_name member in addition to __name__ since Python 2.1, see http://docs.python.org/2.7/library/inspect.html Is this pylint behavior a bug or is it currently unavoidable because it is related to dynamic code as described here? http://www.logilab.org/blogentry/78354 Kind Regards, Andy
![](https://secure.gravatar.com/avatar/82ecda3562749743f8176b6e3a6e9275.jpg?s=120&d=mm&r=g)
On 18 mars 10:31, Andreas Maier wrote:
Hi again,
Hi,
I am using pylint 1.1.0 for Python 2.6 code.
The following code:
def myfunc(): print myfunc.func_name # Incorrectly raises E1101 print myfunc.__name__ # Correctly passes
causes this pylint error to be raised:
E1101: Function 'myfunc' has no 'func_name' member
Python supports the func_name member in addition to __name__ since Python 2.1, see http://docs.python.org/2.7/library/inspect.html
Is this pylint behavior a bug or is it currently unavoidable because it is related to dynamic code as described here? http://www.logilab.org/blogentry/78354
This has been reported in https://bitbucket.org/logilab/pylint/issue/139/no-member-false-positive-for-... It should actually be handled in astroid, or maybe in pylint-brain indeed, but not in pylint itself. -- Sylvain Thénault, LOGILAB, Paris (01.45.32.03.12) - Toulouse (05.62.17.16.42) Formations Python, Debian, Méth. Agiles: http://www.logilab.fr/formations Développement logiciel sur mesure: http://www.logilab.fr/services CubicWeb, the semantic web framework: http://www.cubicweb.org
participants (2)
-
Andreas Maier
-
Sylvain Thénault