[code-quality] How to tell pylint about base class attributes?
pcmanticore at gmail.com
Mon Oct 19 14:08:03 EDT 2015
On Mon, Oct 19, 2015 at 8:29 PM, Skip Montanaro
<skip.montanaro at gmail.com> wrote:
> I'm linting a piece of code containing a class which inherits from a base
> class which is not available at lint time. Consequently, I get all sorts of
> messages about unknown attributes which the subclass uses from its parent.
> Short of completely disabling E1101 (no-member), is there a way to say,
> "class B, a subclass of class A which you can't see, really does have an
> attribute named x"? The code for class A is not going to be available, as
> I'm just running pylint in isolation from the rest of the environment in
> which it is run.
> Skip Montanaro
If it's Pylint 1.5.0 (unreleased), it will not warn no-member if
any of the base classes are unknown. Alternatively, you could
use generated-members option to specify what attributes are
expected to be created at runtime.
Hope this helps.
More information about the code-quality