Search code examples
wxpythonpylint

How to deal with anomalous pylint messages


I am using pylint in vs code.

In one module I have imported wxPython,

import wx

class MainFrame(wx.Frame):
    
    def __init__(self, *args, **kwargs):
        super().__init__(None, *args, **kwargs)

        self.Center()
        self.Show()

if __name__ == '__main__':
    wx_app = wx.App()
    MainFrame()
    wx_app.MainLoop()

However, pylint throws up anomalous errors. For example, on the line:

class MainFrame(wx.Frame):

it reports

Module 'wx' has no 'Frame' member

wx certainly does have a Frame member and the code runs perfectly

How can I deal with these messages? I would prefer that pylint did recognise the members of wxPython, but failing that, suppress the messages


Solution

  • Does this help (option to be added in a pylintrc file) ? If this does not work you can also disable with # pylint: disable=no-member