开发者

Pylint complains about wxPython - 'Too many public methods'

开发者 https://www.devze.com 2023-02-25 01:32 出处:网络
For the following simple wxPython snippets: import sys import wx class MyApp(wx.App): def OnI开发者_C百科nit(self):

For the following simple wxPython snippets:

import sys
import wx

class MyApp(wx.App):
    def OnI开发者_C百科nit(self):
        self.frame = wx.Frame(None, title="Simple wxPython App")
        self.frame.Show()
        self.SetTopWindow(self.frame)
        return True

def main(argv=sys.argv[:]):
    app = MyApp()
    app.MainLoop()
    return 0

if __name__ == '__main__':
    sys.exit(main())

I always got the warning message "R0904: 12:MyApp: Too many public methods" from Pylint. How can I prevent that?


# pylint: disable=R0904

Stick that at the top of the offending class.

On older versions of Pylint, you have to use

# pylint: disable-msg=R0904

Unfortunately, if you ever upgrade to a more recent version you'll have to write a sed script to replace all instances of # pylint: disable-msg with # pylint: disable.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号