In defence of 80-char lines

Peter Otten __peter__ at web.de
Thu Apr 4 02:43:06 EDT 2013


llanitedave wrote:

> I also tend to prefer a maximum between 110 and 120 characters.  I find
> continuation lines confusing, and when you use some third-party tools,
> such as wxPython, for example, the boilerplate code leads to some long
> lines.
> 
> I would hate to have to break up this line, for instance:
> 
> self.mainLabel.SetFont(wx.Font(12, wx.DEFAULT, wx.NORMAL, wx.BOLD,
> faceName = "FreeSans"))

I'm not a wx user, but I think I would prefer

labelfont = wx.Font(
    pointSize=12,
    style=wx.DEFAULT,
    family=wx.NORMAL,
    weight=wx.BOLD,
    faceName="FreeSans")
self.mainLabel.SetFont(labelfont)

even if I knew the order of the arguments and the meaning of constants like 
DEFAULT and NORMAL by heart.




More information about the Python-list mailing list