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-functions 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 _______________________________________________ code-quality mailing list code-quality@python.org https://mail.python.org/mailman/listinfo/code-quality