11

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?

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Drake Guan
  • 14,514
  • 15
  • 67
  • 94

1 Answers1

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

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
nmichaels
  • 49,466
  • 12
  • 107
  • 135