Pylint complains about wxPython - 'Too many public methods'
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
.
精彩评论