Re: Allowing comments after the line continuation backslash

2010-11-10 Thread Robert Kern
On 11/10/10 12:26 AM, Lawrence D'Oliveiro wrote: In message, Robert Kern wrote: For me, putting the brackets on their own lines (and using a trailing comma) has little to do with increasing readability. It's for making editing easier. Keeping all of the items consistent means that in order to a

Re: Allowing comments after the line continuation backslash

2010-11-10 Thread Mark Wooding
Lawrence D'Oliveiro writes: > In message <878w12kt5x.fsf@metalzone.distorted.org.uk>, Mark Wooding > wrote: > > 2. The MainWindow class only has the `Window' attribute described in > > its definition. Apparently there are other attributes as well (the > > ColorMumbleList family

Re: Allowing comments after the line continuation backslash

2010-11-09 Thread Lawrence D'Oliveiro
In message <878w12kt5x.fsf@metalzone.distorted.org.uk>, Mark Wooding wrote: > Lawrence D'Oliveiro writes: > >> Maybe you should look at the code in context >> , then you can express some >> more opinions on how to improve it. > > 1. class keyval:

Re: Allowing comments after the line continuation backslash

2010-11-09 Thread Lawrence D'Oliveiro
In message , Robert Kern wrote: > For me, putting the brackets on their own lines (and using a trailing > comma) has little to do with increasing readability. It's for making > editing easier. Keeping all of the items consistent means that in order to > add, delete, or move any item is the same o

Re: Allowing comments after the line continuation backslash

2010-11-09 Thread Robert Kern
On 2010-11-09 19:39 , Mark Wooding wrote: Tim Chase writes: On 11/09/10 18:05, Robert Kern wrote: For me, putting the brackets on their own lines (and using a trailing comma) has little to do with increasing readability. It's for making editing easier. It also makes diff's much easier to re

Re: Allowing comments after the line continuation backslash

2010-11-09 Thread Tim Chase
On 11/09/10 19:39, Mark Wooding wrote: Tim Chase writes: It also makes diff's much easier to read Hmm. That's a good point, actually. I'm not overly fussed about the ease of editing: it doesn't seem especially hard either way. But nice diffs are definitely valuable. Food for thought; than

Re: Allowing comments after the line continuation backslash

2010-11-09 Thread Mark Wooding
Tim Chase writes: > On 11/09/10 18:05, Robert Kern wrote: > > For me, putting the brackets on their own lines (and using a > > trailing comma) has little to do with increasing readability. It's > > for making editing easier. > > It also makes diff's much easier to read (my big impetus for doing t

Re: Allowing comments after the line continuation backslash

2010-11-09 Thread Tim Chase
On 11/09/10 18:05, Robert Kern wrote: For me, putting the brackets on their own lines (and using a trailing comma) has little to do with increasing readability. It's for making editing easier. It also makes diff's much easier to read (my big impetus for doing the same as Robert) -tkc -- ht

Re: Allowing comments after the line continuation backslash

2010-11-09 Thread Robert Kern
On 11/9/10 4:51 PM, Mark Wooding wrote: Lawrence D'Oliveiro writes: In message<87fwvdb69k.fsf@metalzone.distorted.org.uk>, Mark Wooding wrote: for descr, attr, colours in [ ('normal', 'image','Normal'), ('highlighted', 'highlight','Highlighted'),

Re: Allowing comments after the line continuation backslash

2010-11-09 Thread Mark Wooding
Lawrence D'Oliveiro writes: > In message <87fwvdb69k.fsf@metalzone.distorted.org.uk>, Mark Wooding > wrote: > > for descr, attr, colours in [ > > ('normal', 'image','Normal'), > > ('highlighted', 'highlight','Highlighted'), > > ('selected','select'

Re: Allowing comments after the line continuation backslash

2010-11-08 Thread Lawrence D'Oliveiro
In message <87fwvdb69k.fsf@metalzone.distorted.org.uk>, Mark Wooding wrote: > Lawrence D'Oliveiro writes: > >> for \ >> Description, Attr, ColorList \ >> in \ >> ( >> ("normal", "image", MainWindow.ColorsNormalList), >> ("highlighted", "highlig

Re: Allowing comments after the line continuation backslash

2010-11-08 Thread Neil Cerutti
On 2010-11-06, Steven D'Aprano wrote: >>> styles = [ >>> ("normal", "image", MainWindow.ColorsNormalList), >>> ("highlighted", "highlight", MainWindow.ColorsHighlightedList), >>> ("selected","select",MainWindow.ColorsSelectedList)] >> >> Code should be

Re: Allowing comments after the line continuation backslash

2010-11-07 Thread Mark Wooding
Lawrence D'Oliveiro writes: > Not surprising, since the above list has become completely divorced from its > original purpose. Anybody remember what that was? It was supposed to be used > in a loop, as follows: > > for \ > Description, Attr, ColorList \ > in \ > ( >

Re: Allowing comments after the line continuation backslash

2010-11-07 Thread Steven D'Aprano
On Sun, 07 Nov 2010 19:33:52 +1300, Lawrence D'Oliveiro wrote: > for \ > Description, Attr, ColorList \ > in \ > ( > ("normal", "image", MainWindow.ColorsNormalList), > ("highlighted", "highlight", > MainWindow.ColorsHighlightedList), ("s

Re: Allowing comments after the line continuation backslash

2010-11-06 Thread Lawrence D'Oliveiro
In message , Roy Smith wrote: > In article , > Lawrence D'Oliveiro wrote: > >> In message <8jd3m9fr5...@mid.individual.net>, Neil Cerutti wrote: >> >> > On 2010-11-03, Ben Finney wrote: >> > >> >> styles = [ >> >> ("normal", "image", MainWindow.ColorsNormalList), >> >>

Re: Allowing comments after the line continuation backslash

2010-11-06 Thread Roy Smith
In article , Lawrence D'Oliveiro wrote: > In message <8jd3m9fr5...@mid.individual.net>, Neil Cerutti wrote: > > > On 2010-11-03, Ben Finney wrote: > > > >> styles = [ > >> ("normal", "image", MainWindow.ColorsNormalList), > >> ("highlighted", "highlight", MainWindo

Re: Allowing comments after the line continuation backslash

2010-11-06 Thread Steven D'Aprano
On Wed, 03 Nov 2010 12:42:49 +, Neil Cerutti wrote: > On 2010-11-03, Ben Finney wrote: >> I would do the same, but fix the indentation. Making indentation depend >> on the *length* of the previous line is needlessly making a maintenance >> burden. >> >> Instead, I'd do:: >> >> styles = [

Re: Allowing comments after the line continuation backslash

2010-11-06 Thread Lawrence D'Oliveiro
In message <8jd3m9fr5...@mid.individual.net>, Neil Cerutti wrote: > On 2010-11-03, Ben Finney wrote: > >> styles = [ >> ("normal", "image", MainWindow.ColorsNormalList), >> ("highlighted", "highlight", MainWindow.ColorsHighlightedList), >> ("selected","sel

Re: Allowing comments after the line continuation backslash

2010-11-04 Thread Lawrence D'Oliveiro
In message , Chris Rebert wrote: > Actually, my PEP 8 reference was in regards to the (imo, terrible) > UseOfCamelCaseForNonClasses (Python != C#), not the formatting of the > for-loop; hence the "In any case" qualification. Hmm ... OK, I might accept that particular criticism. I have to say it’

Re: Allowing comments after the line continuation backslash

2010-11-04 Thread Lawrence D'Oliveiro
In message , Roy Smith wrote: >> > > That URL takes me to a github page. Can you be more specific about > which file I should be looking at? The extract I previously quoted was from dvd_menu_animator. > 2) You have provided comments for each function,

Re: Allowing comments after the line continuation backslash

2010-11-03 Thread Neil Cerutti
On 2010-11-03, Ben Finney wrote: > I would do the same, but fix the indentation. Making > indentation depend on the *length* of the previous line is > needlessly making a maintenance burden. > > Instead, I'd do:: > > styles = [ > ("normal", "image", MainWindow.ColorsNormalList

Re: Allowing comments after the line continuation backslash

2010-11-03 Thread Roy Smith
In article , Lawrence D'Oliveiro wrote: > > I suppose readability is in the eye of the reader, but, yes, I agree > > that I have split this into two parts. The parts are > > > > 1) The table of data > > > > 2) The looping construct > > But the table of data makes no sense outside of the loop

Re: Allowing comments after the line continuation backslash

2010-11-03 Thread Chris Rebert
On Mon, Nov 1, 2010 at 8:15 PM, Lawrence D'Oliveiro wrote: > In message , Chris > Rebert wrote: > >> desc_attr_colors_triples = (("normal", "image", >> MainWindow.ColorsNormalList), >>     ("highlighted", "highlight", MainWindow.ColorsHighlightedList), >>     ("selected", "select", MainWindow.Colo

Re: Allowing comments after the line continuation backslash

2010-11-03 Thread Lawrence D'Oliveiro
In message , Roy Smith wrote: > In article , > Lawrence D'Oliveiro wrote: > >> In message , Roy Smith wrote: >> >> > In this case, I think I would do: >> > >> > styles = [("normal", "image", MainWindow.ColorsNormalList), >> > ("highlighted", "highlight", >> > Main

Re: Allowing comments after the line continuation backslash

2010-11-02 Thread Ben Finney
Robert Kern writes: > I'd go one step further: > > styles = [ > ("normal", "image", MainWindow.ColorsNormalList), > ("highlighted", "highlight", MainWindow.ColorsHighlightedList), > ("selected","select",MainWindow.ColorsSelectedList), > ] > > Keepi

Re: Allowing comments after the line continuation backslash

2010-11-02 Thread Robert Kern
On 2010-11-02 19:46 , Ben Finney wrote: Instead, I'd do:: styles = [ ("normal", "image", MainWindow.ColorsNormalList), ("highlighted", "highlight", MainWindow.ColorsHighlightedList), ("selected","select",MainWindow.ColorsSelectedList)] I'd go o

Re: Allowing comments after the line continuation backslash

2010-11-02 Thread Ben Finney
Roy Smith writes: > In article , > Lawrence D'Oliveiro wrote: > > > In message , Roy Smith wrote: > > > > > In this case, I think I would do: > > > > > > styles = [("normal", "image", MainWindow.ColorsNormalList), > > > ("highlighted", "highlight", MainWindow.ColorsHighligh

Re: Allowing comments after the line continuation backslash

2010-11-02 Thread Roy Smith
In article , Lawrence D'Oliveiro wrote: > In message , Roy Smith wrote: > > > In this case, I think I would do: > > > > styles = [("normal", "image", MainWindow.ColorsNormalList), > > ("highlighted", "highlight", MainWindow.ColorsHighlightedList), > > ("selected",

Re: Allowing comments after the line continuation backslash

2010-11-02 Thread Lawrence D'Oliveiro
In message , Roy Smith wrote: > In this case, I think I would do: > > styles = [("normal", "image", MainWindow.ColorsNormalList), > ("highlighted", "highlight", MainWindow.ColorsHighlightedList), > ("selected","select",MainWindow.ColorsSelectedList)] > > for

Re: Allowing comments after the line continuation backslash

2010-11-02 Thread Roy Smith
In article , Chris Rebert wrote: > I find the level of deviation from PEP 8 in that file rather disturbing. > In any case, the backslashes are easily avoided, and readability > improved IMHO, via refactoring: > > desc_attr_colors_triples = (("normal", "image", MainWindow.ColorsNormalList), >

Re: Allowing comments after the line continuation backslash

2010-11-02 Thread Steven D'Aprano
On Tue, 02 Nov 2010 11:16:46 +1300, Lawrence D'Oliveiro wrote: > In message <4cce6ff6.2050...@v.loewis.de>, Martin v. Loewis wrote: > >> (in fact, I can't think any situation where I would use the backslash). > > for \ > Description, Attr, ColorList \ > in \ > ( >

Re: Allowing comments after the line continuation backslash

2010-11-01 Thread Lawrence D'Oliveiro
In message , Chris Rebert wrote: > desc_attr_colors_triples = (("normal", "image", > MainWindow.ColorsNormalList), > ("highlighted", "highlight", MainWindow.ColorsHighlightedList), > ("selected", "select", MainWindow.ColorsSelectedList)) > for in description, attr, color_list in desc_attr

Re: Allowing comments after the line continuation backslash

2010-11-01 Thread Chris Rebert
On Mon, Nov 1, 2010 at 3:16 PM, Lawrence D'Oliveiro wrote: > In message <4cce6ff6.2050...@v.loewis.de>, Martin v. Loewis wrote: > >> (in fact, I can't think any situation where I would use the backslash). > >    for \ >        Description, Attr, ColorList \ >    in \ >        ( >            ("norm

Re: Allowing comments after the line continuation backslash

2010-11-01 Thread Lawrence D'Oliveiro
In message <4cce6ff6.2050...@v.loewis.de>, Martin v. Loewis wrote: > (in fact, I can't think any situation where I would use the backslash). for \ Description, Attr, ColorList \ in \ ( ("normal", "image", MainWindow.ColorsNormalList), ("highlighted"

Re: Allowing comments after the line continuation backslash

2010-11-01 Thread Neil Cerutti
On 2010-11-01, Martin v. Loewis wrote: > i.e. avoid the backslash for multi-line conditions altogether > (in fact, I can't think any situation where I would use the > backslash). The horrible-to-nest with statement. -- Neil Cerutti -- http://mail.python.org/mailman/listinfo/python-list

Re: Allowing comments after the line continuation backslash

2010-11-01 Thread Steven D'Aprano
On Sun, 31 Oct 2010 23:13:19 -0700, Yingjie Lan wrote: > Hi, > > Sorry if I am baking too many ideas today. I am just having trouble with > the backslashes Then don't use them. If you are having so much trouble keeping your lines short, then I suggest you're trying to do too much in one li

Re: Allowing comments after the line continuation backslash

2010-11-01 Thread Ulrich Eckhardt
Yingjie Lan wrote: > I would like to have comments after the line continuation backslash. > if a > 0 \ #comments for this condition > and b > 0: > #do something here Historically, and also in Python, the backslash escapes the immediately following character. That means that _nothin

Re: Allowing comments after the line continuation backslash

2010-11-01 Thread Martin v. Loewis
> Sorry if I am baking too many ideas today. > I am just having trouble with the backslashes > > I would like to have comments after the line continuation backslash. > if a > 0 \ #comments for this condition > and b > 0: > #do something here > > This is currently not OK, but t

Re: Allowing comments after the line continuation backslash

2010-11-01 Thread Lawrence D'Oliveiro
In message , Yingjie Lan wrote: > I would like to have comments after the line continuation backslash. What language allows that? -- http://mail.python.org/mailman/listinfo/python-list

Allowing comments after the line continuation backslash

2010-10-31 Thread Yingjie Lan
Hi, Sorry if I am baking too many ideas today. I am just having trouble with the backslashes I would like to have comments after the line continuation backslash. >>> if a > 0 \ #comments for this condition and b > 0: #do something here This is currently not OK, but this might be a