[Python-projects] pylint: class methods created by metaclass not recognized

Amorilia amorilia at users.sourceforge.net
Sun Oct 28 12:26:35 CET 2007


Pylint 0.13.2 says "Instance of 'XYZ' has no 'xyz' member" when a
class XYZ has a method xyz created by its metaclass. Attached is a
very simple example triggering the bug. (The use case I'm interested
in is a metaclass which parses an xml file in order to serialize,
among many other things, attribute creation in a class, on which I'm
getting of course a huge amount of these pylint errors.)

Aside, I looked into checkers/typecheck.py in an attempt to fix it as
the error seems to be triggered there. I was a bit lost in the code
though. Does pylint actually instantiate metaclasses of classes (i.e.
create the classes) that it must check?

Thanks,
Amorilia
-------------- next part --------------
A non-text attachment was scrubbed...
Name: testmetaclass.py
Type: text/x-python
Size: 1063 bytes
Desc: not available
URL: <http://lists.logilab.org/pipermail/python-projects/attachments/20071028/ce5e9993/attachment-0086.py>


More information about the Python-Projects mailing list