trailing underscores naming convention_

Peter Otten __peter__ at web.de
Fri May 9 05:10:26 EDT 2014


Metallicow wrote:

> I guess to be more clear here is a small code snippet that shows what is
> happening more readably. Hence the underscores question.

Working with multiple names with small differences is error-prone.
You should give a method a name that describes what it does rather than when 
it's invoked:

> class MainAuiManager(aui.AuiManager):
>     def __init__(self, managed_window=None, agwFlags=0)
>         aui.AuiManager.__init__(self, managed_window, agwFlags)

          self.Bind(wx.EVT_LEFT_DCLICK, self.EatMagicMushroom)
          self.Bind(wx.EVT_LEFT_DCLICK, self.KillBlueMonster)
          self.Bind(wx.EVT_LEFT_DCLICK, self.SingDitty)





More information about the Python-list mailing list