Re: [Python-Dev] A grammatical oddity: trailing commas in argument lists -- continuation

2010-12-18 Thread Glenn Linderman
On 12/18/2010 1:04 PM, Georg Brandl wrote: Am 13.12.2010 21:08, schrieb Glenn Linderman: On 12/13/2010 11:39 AM, Mark Dickinson wrote: my_thing = Thing( foo = Foo(arg1, arg2, ...), bar = Bar(arg3, arg4, ...), ... ) and I've found the trailing comma very convenient during refa

Re: [Python-Dev] A grammatical oddity: trailing commas in argument lists -- continuation

2010-12-18 Thread Georg Brandl
Am 13.12.2010 21:08, schrieb Glenn Linderman: > On 12/13/2010 11:39 AM, Mark Dickinson wrote: >> my_thing = Thing( >> foo = Foo(arg1, arg2, ...), >> bar = Bar(arg3, arg4, ...), >> ... >> ) >> >> and I've found the trailing comma very convenient during refactoring >> and API experimen

Re: [Python-Dev] A grammatical oddity: trailing commas in argument lists -- continuation

2010-12-14 Thread Ethan Furman
Terry Reedy wrote: On 12/13/2010 2:17 PM, Antoine Pitrou wrote: On Mon, 13 Dec 2010 14:09:02 -0500 Alexander Belopolsky wrote: On Mon, Dec 13, 2010 at 11:54 AM, Guido van Rossum wrote: I'm at least +0 on allowing trailing commas in the situation the OP mentioned. FWIW, I am also about +0

Re: [Python-Dev] A grammatical oddity: trailing commas in argument lists -- continuation

2010-12-13 Thread Raymond Hettinger
On Dec 13, 2010, at 2:16 PM, Guido van Rossum wrote: > On Mon, Dec 13, 2010 at 1:55 PM, Raymond Hettinger > wrote: >> >> It seems to me that a trailing comma in an argument list is more likely to >> be a user error than a deliberate comma-for-the-future. > > Really? Have you observed this? Ev

Re: [Python-Dev] A grammatical oddity: trailing commas in argument lists -- continuation

2010-12-13 Thread Nick Coghlan
On Tue, Dec 14, 2010 at 5:39 AM, Mark Dickinson wrote: > On Mon, Dec 13, 2010 at 3:51 PM, R. David Murray > wrote: > > It seems like the status quo is fine. I wouldn't object to it being > > made more consistent. I would object to removing the existing cases. > > Same here, on all three counts

Re: [Python-Dev] A grammatical oddity: trailing commas in argument lists -- continuation

2010-12-13 Thread Glenn Linderman
On 12/13/2010 1:55 PM, Raymond Hettinger wrote: It seems to me that a trailing comma in an argument list is more likely to be a user error than a deliberate comma-for-the-future. It seems to me that a trailing comma, especially in the case of one parameter per line, is a deliberate comma-for-

Re: [Python-Dev] A grammatical oddity: trailing commas in argument lists -- continuation

2010-12-13 Thread Guido van Rossum
On Mon, Dec 13, 2010 at 1:55 PM, Raymond Hettinger wrote: > > On Dec 13, 2010, at 1:21 PM, Terry Reedy wrote: > >> Same here. A strong +1 for a consistent rule (always or never allowed) with >> a +1 for always given others use case of one param/arg per line. > > > > It seems to me that a trailing

Re: [Python-Dev] A grammatical oddity: trailing commas in argument lists -- continuation

2010-12-13 Thread Raymond Hettinger
On Dec 13, 2010, at 1:21 PM, Terry Reedy wrote: > Same here. A strong +1 for a consistent rule (always or never allowed) with a > +1 for always given others use case of one param/arg per line. It seems to me that a trailing comma in an argument list is more likely to be a user error than a d

Re: [Python-Dev] A grammatical oddity: trailing commas in argument lists -- continuation

2010-12-13 Thread Terry Reedy
On 12/13/2010 2:17 PM, Antoine Pitrou wrote: On Mon, 13 Dec 2010 14:09:02 -0500 Alexander Belopolsky wrote: On Mon, Dec 13, 2010 at 11:54 AM, Guido van Rossum wrote: I'm at least +0 on allowing trailing commas in the situation the OP mentioned. FWIW, I am also about +0.5 on allowing trail

Re: [Python-Dev] A grammatical oddity: trailing commas in argument lists -- continuation

2010-12-13 Thread Cameron Simpson
On 13Dec2010 20:17, Antoine Pitrou wrote: | On Mon, 13 Dec 2010 14:09:02 -0500 | Alexander Belopolsky wrote: | | > On Mon, Dec 13, 2010 at 11:54 AM, Guido van Rossum wrote: | > > I'm at least +0 on | > > allowing trailing commas in the situation the OP mentioned. | > > | > | > FWIW, I am also

Re: [Python-Dev] A grammatical oddity: trailing commas in argument lists -- continuation

2010-12-13 Thread Glenn Linderman
On 12/13/2010 11:39 AM, Mark Dickinson wrote: my_thing = Thing( foo = Foo(arg1, arg2, ...), bar = Bar(arg3, arg4, ...), ... ) and I've found the trailing comma very convenient during refactoring and API experimentation. (There's still good fun to be had arguing about the indentat

Re: [Python-Dev] A grammatical oddity: trailing commas in argument lists -- continuation

2010-12-13 Thread Mark Dickinson
On Mon, Dec 13, 2010 at 3:51 PM, R. David Murray wrote: > It seems like the status quo is fine.  I wouldn't object to it being > made more consistent.  I would object to removing the existing cases. Same here, on all three counts. In one of the projects I'm currently working on, we've settled on

Re: [Python-Dev] A grammatical oddity: trailing commas in argument lists -- continuation

2010-12-13 Thread Glenn Linderman
On 12/13/2010 11:17 AM, Antoine Pitrou wrote: On Mon, 13 Dec 2010 14:09:02 -0500 Alexander Belopolsky wrote: On Mon, Dec 13, 2010 at 11:54 AM, Guido van Rossum wrote: I'm at least +0 on allowing trailing commas in the situation the OP mentioned. FWIW, I am also about +0.5 on allowing trail

Re: [Python-Dev] A grammatical oddity: trailing commas in argument lists -- continuation

2010-12-13 Thread Antoine Pitrou
On Mon, 13 Dec 2010 14:09:02 -0500 Alexander Belopolsky wrote: > On Mon, Dec 13, 2010 at 11:54 AM, Guido van Rossum wrote: > > I'm at least +0 on > > allowing trailing commas in the situation the OP mentioned. > > > > FWIW, I am also about +0.5 on allowing trailing comma. Note that in a > simi

Re: [Python-Dev] A grammatical oddity: trailing commas in argument lists -- continuation

2010-12-13 Thread Alexander Belopolsky
On Mon, Dec 13, 2010 at 11:54 AM, Guido van Rossum wrote: > I'm at least +0 on > allowing trailing commas in the situation the OP mentioned. > FWIW, I am also about +0.5 on allowing trailing comma. Note that in a similar situation, the C standardization committee has erred on the side of consis

Re: [Python-Dev] A grammatical oddity: trailing commas in argument lists -- continuation

2010-12-13 Thread Guido van Rossum
On Mon, Dec 13, 2010 at 5:42 AM, Tres Seaver wrote: > I actually make use of the feature when dealing with APIs which both a) > take lots of arguments (more than fit comfortably on two lines at > whatever indentation they are called), and b) have optional trailing > arguments:  I always leave the

Re: [Python-Dev] A grammatical oddity: trailing commas in argument lists -- continuation

2010-12-13 Thread R. David Murray
On Mon, 13 Dec 2010 23:25:58 +1000, Nick Coghlan wrote: > On Mon, Dec 13, 2010 at 9:44 PM, Jan Kaliszewski wrote: > > I think that seeing that: > > > > =A0 =A0def f(a, b): ... > > =A0 =A0def f(a, *, b): ... > > =A0 =A0def f(a, *args, b): ... > > =A0 =A0x(1, 2, 3, 4, z=3D5) > > =A0 =A0x(1, *(2,3,4

Re: [Python-Dev] A grammatical oddity: trailing commas in argument lists -- continuation

2010-12-13 Thread Jan Kaliszewski
Nick Coghlan dixit (2010-12-13, 23:25): > Function arguments are not lists. Even when separated onto multiple > lines, the closing "):" should remain on the final line with other > content. Not necessarily, IMHO. 1. What about my example with '-> xxx' return-value annotation? (especially when th

Re: [Python-Dev] A grammatical oddity: trailing commas in argument lists -- continuation

2010-12-13 Thread Nick Coghlan
On Mon, Dec 13, 2010 at 11:42 PM, Tres Seaver wrote: > I actually make use of the feature when dealing with APIs which both a) > take lots of arguments (more than fit comfortably on two lines at > whatever indentation they are called), and b) have optional trailing > arguments:  I always leave the

Re: [Python-Dev] A grammatical oddity: trailing commas in argument lists -- continuation

2010-12-13 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 12/13/2010 08:25 AM, Nick Coghlan wrote: > On Mon, Dec 13, 2010 at 9:44 PM, Jan Kaliszewski wrote: >> I think that seeing that: >> >>def f(a, b): ... >>def f(a, *, b): ... >>def f(a, *args, b): ... >>x(1, 2, 3, 4, z=5) >>x(1, *(

Re: [Python-Dev] A grammatical oddity: trailing commas in argument lists -- continuation

2010-12-13 Thread Michael Foord
On 13/12/2010 13:25, Nick Coghlan wrote: On Mon, Dec 13, 2010 at 9:44 PM, Jan Kaliszewski wrote: I think that seeing that: def f(a, b): ... def f(a, *, b): ... def f(a, *args, b): ... x(1, 2, 3, 4, z=5) x(1, *(2,3,4), z=5) As per the closure of the affected tickets, the li

Re: [Python-Dev] A grammatical oddity: trailing commas in argument lists -- continuation

2010-12-13 Thread Nick Coghlan
On Mon, Dec 13, 2010 at 9:44 PM, Jan Kaliszewski wrote: > I think that seeing that: > >    def f(a, b): ... >    def f(a, *, b): ... >    def f(a, *args, b): ... >    x(1, 2, 3, 4, z=5) >    x(1, *(2,3,4), z=5) As per the closure of the affected tickets, the likely outcome of such a discussion wo

[Python-Dev] A grammatical oddity: trailing commas in argument lists -- continuation

2010-12-13 Thread Jan Kaliszewski
Dear Python Developers, It is s my first post to python-dev, so let me introduce myself briefly: Jan Kaliszewski, programmer and composer, sometimes also NGO activist. Coming to the matter... The discussion started with remark by Mark Dickinson about such a syntax oddity: > def f(a, b,): ...