On 4 April 2013 12:09, Tim Chase <python.l...@tim.thechases.com> wrote:
> On 2013-04-04 08:43, Peter Otten wrote: > > llanitedave wrote: > >> self.mainLabel.SetFont(wx.Font(12, wx.DEFAULT, wx.NORMAL, wx.BOLD, > faceName = "FreeSans")) > > > > 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) > > +1 > The only change I'd make to this suggestion would be to add a > semi-superfluous comma+newline after the last keyword argument too: > > labelfont = wx.Font( > pointSize=12, > style=wx.DEFAULT, > family=wx.NORMAL, > weight=wx.BOLD, > faceName="FreeSans", > ) > Since we're all showing opinions, I've always prefered the typical block indentation: labelfont = wx.Font( pointSize=12, style=wx.DEFAULT, family=wx.NORMAL, weight=wx.BOLD, faceName="FreeSans", ) # Not indented here as A( B( C, D, E, ) ) reads a lot cleaner than A( B( C, D, E ) ) which makes diffs cleaner when you need to insert something after > faceName: > <DIFS SNIP> That is a very good point :). Additionally, if there are lots of keyword parameters like this, I'd > be tempted to keep them in sorted order for ease of tracking them > down (though CSS has long-standing arguments on how properties should > be ordered, so to each their own on this). > Personally I'd rarely be tempted to put more than 9 or so arguments directly into a function or class. Most of the time I can imagine unpacking (or equiv.) would look much more readable in the circumstances that apply.
-- http://mail.python.org/mailman/listinfo/python-list