Re: In defence of 80-char lines

2013-04-04 Thread Steven D'Aprano
On Thu, 04 Apr 2013 13:28:04 -0700, jmfauth wrote: > With "unicode fonts", where even the monospaced fonts present char > widths with a variable width depending on the unicode block (obvious > reasons), speaking of a "text width" in chars has not even a sense. A properly-designed Unicode monospac

Re: In defence of 80-char lines

2013-04-04 Thread Roy Smith
In article , Kushal Kumaran wrote: > > Is using csv.DictReader with delimiter=' ' not sufficient for this? I > did not actually read the regular expression in its entirety. I believe your second sentence answers the question raised in your first sentence :-) -- http://mail.python.org/mailma

Re: In defence of 80-char lines

2013-04-04 Thread Jason Swails
On Thu, Apr 4, 2013 at 4:28 PM, jmfauth wrote: > On 4 avr, 03:36, Steven D'Aprano +comp.lang.pyt...@pearwood.info> wrote: > > Although PEP 8 is only compulsory for the Python standard library, many > > users like to stick to PEP 8 for external projects. > > > > http://www.python.org/dev/peps/pep

Re: In defence of 80-char lines

2013-04-04 Thread jmfauth
On 4 avr, 03:36, Steven D'Aprano wrote: > Although PEP 8 is only compulsory for the Python standard library, many > users like to stick to PEP 8 for external projects. > > http://www.python.org/dev/peps/pep-0008/ > > With perhaps one glaring exception: many people hate, or ignore, PEP 8's > recomm

Re: In defence of 80-char lines

2013-04-04 Thread Kushal Kumaran
Roy Smith writes: > In article , > Jason Swails wrote: > >> The only time I regularly break my rule is for regular expressions (at some >> point I may embrace re.X to allow me to break those up, too). > > re.X is a pretty cool tool for making huge regexes readable. But, it > turns out that py

Re: In defence of 80-char lines

2013-04-04 Thread Joshua Landau
On 4 April 2013 12:09, Tim Chase 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, > > styl

Re: In defence of 80-char lines

2013-04-04 Thread Mitya Sirenef
On 04/03/2013 09:36 PM, Steven D'Aprano wrote: Although PEP 8 is only compulsory for the Python standard library, many > users like to stick to PEP 8 for external projects. > > http://www.python.org/dev/peps/pep-0008/ > > With perhaps one glaring exception: many people hate, or ignore, PEP 8's

Re: In defence of 80-char lines

2013-04-04 Thread Neil Cerutti
On 2013-04-04, Roy Smith wrote: > re.X is a pretty cool tool for making huge regexes readable. > But, it turns out that python's auto-continuation and string > literal concatenation rules are enough to let you get much the > same effect. Here's a regex we use to parse haproxy log files. > This wo

Re: In defence of 80-char lines

2013-04-04 Thread llanitedave
On Thursday, April 4, 2013 4:52:38 AM UTC-7, Roy Smith wrote: > In article , > > llanitedave wrote: > > > > > 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")) > >

Re: In defence of 80-char lines

2013-04-04 Thread Jason Swails
On Thu, Apr 4, 2013 at 8:39 AM, Roy Smith wrote: > In article , > Jason Swails wrote: > > > The only time I regularly break my rule is for regular expressions (at > some > > point I may embrace re.X to allow me to break those up, too). > > re.X is a pretty cool tool for making huge regexes read

Re: In defence of 80-char lines

2013-04-04 Thread Roy Smith
In article , Jason Swails wrote: > The only time I regularly break my rule is for regular expressions (at some > point I may embrace re.X to allow me to break those up, too). re.X is a pretty cool tool for making huge regexes readable. But, it turns out that python's auto-continuation and str

Re: In defence of 80-char lines

2013-04-04 Thread Jason Swails
On Thu, Apr 4, 2013 at 7:09 AM, Tim Chase 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, > >

Re: In defence of 80-char lines

2013-04-04 Thread Jason Swails
On Wed, Apr 3, 2013 at 9:36 PM, Steven D'Aprano < steve+comp.lang.pyt...@pearwood.info> wrote: > Although PEP 8 is only compulsory for the Python standard library, many > users like to stick to PEP 8 for external projects. > But even the standard library breaks this rule on occasion. e.g., /usr/

Re: In defence of 80-char lines

2013-04-04 Thread Roy Smith
In article , llanitedave wrote: > 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 would write that as some variation on self.mainLabel.SetFont(wx.Font(12,

Re: In defence of 80-char lines

2013-04-04 Thread Tim Chase
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.BO

Re: In defence of 80-char lines

2013-04-04 Thread Rui Maciel
Steven D'Aprano wrote: > Although PEP 8 is only compulsory for the Python standard library, many > users like to stick to PEP 8 for external projects. > > http://www.python.org/dev/peps/pep-0008/ > > With perhaps one glaring exception: many people hate, or ignore, PEP 8's > recommendation to lim

Re: In defence of 80-char lines

2013-04-03 Thread gregor
Am Wed, 3 Apr 2013 21:32:33 -0700 (PDT) schrieb llanitedave : > 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 think this is much more readable: self.mainLabel.SetFont(wx.Font(12,

Re: In defence of 80-char lines

2013-04-03 Thread Peter Otten
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, f

Re: In defence of 80-char lines

2013-04-03 Thread Steven D'Aprano
On Wed, 03 Apr 2013 21:32:33 -0700, 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. Excessive boi

Re: In defence of 80-char lines

2013-04-03 Thread rusi
On Apr 4, 6:36 am, Steven D'Aprano wrote: > Although PEP 8 is only compulsory for the Python standard library, many > users like to stick to PEP 8 for external projects. > > http://www.python.org/dev/peps/pep-0008/ > > http://blog.languager.org/2012/10/layout-imperative-in-functional.htmlith > pe

Re: In defence of 80-char lines

2013-04-03 Thread llanitedave
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.S

Re: In defence of 80-char lines

2013-04-03 Thread Mitya Sirenef
On 04/03/2013 09:59 PM, Andrew Berg wrote: While I agree that not having a line take up hundreds of characters is a > good thing, 80 is really arbitrary in 2013 and having any self-imposed > hard limit is silly. When you put a single 4- or 5-character word on a > new line because you don't want

Re: In defence of 80-char lines

2013-04-03 Thread Andrew Berg
While I agree that not having a line take up hundreds of characters is a good thing, 80 is really arbitrary in 2013 and having any self-imposed hard limit is silly. When you put a single 4- or 5-character word on a new line because you don't want to go over 80 (or 120 or whatever), the code is /les

In defence of 80-char lines

2013-04-03 Thread Steven D'Aprano
Although PEP 8 is only compulsory for the Python standard library, many users like to stick to PEP 8 for external projects. http://www.python.org/dev/peps/pep-0008/ With perhaps one glaring exception: many people hate, or ignore, PEP 8's recommendation to limit lines to 80 characters. (Strictl