Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pylint complains about wxPython 'Too many public methods'

For the following simple wxPython snippets:

import sys
import wx

class MyApp(wx.App):
    def OnInit(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?

like image 646
Drake Guan Avatar asked Apr 14 '11 15:04

Drake Guan


1 Answers

# 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.

like image 88
nmichaels Avatar answered Nov 03 '22 03:11

nmichaels