Re: [Python-Dev] removing nested tuple function parameters

2005-09-19 Thread Greg Ewing
Andrew Koenig wrote: > One other reason: It is possible to imagine using the feature to catch some > type errors at the point of call, rather than having to get into the > function itself before detecting them. Not a big deal - you just need to look one line further up in the traceback to find wh

Re: [Python-Dev] removing nested tuple function parameters

2005-09-19 Thread Greg Ewing
Terry Reedy wrote: > I consider the current situation to be a consistency feature. To a first > approximation, Python function calls 'pass' objects by name-binding: > > param_name_list = arg_object_list > > Disabling structure unpacking in this assignment would make the language > slightly mor

Re: [Python-Dev] removing nested tuple function parameters

2005-09-19 Thread Greg Ewing
Steven Bethard wrote: > I guess if tuple unpacking in function parameters goes away, I think > we should change the __getitem__ machinery so that: > > obj[x1, x2, ..., xN] > > is translated to: > > obj.__getitem__(x1, x2, ..., xN) > > where __getitem__ would now have to take a *args wh

Re: [Python-Dev] removing nested tuple function parameters

2005-09-19 Thread Michael Hudson
"Andrew Koenig" <[EMAIL PROTECTED]> writes: >> The only practical reason to like this feature is sparing the need of >> finding an otherwise useless name for the formal argument. Another >> reason, but not practical at all, is that the concept conveys some >> elegance and originality (each progra

[Python-Dev] removing nested tuple function parameters

2005-09-19 Thread Jim Jewett
Andrew Koenig wrote: > It is possible to imagine using the feature to catch some > type errors at the point of call, rather than having to get into the > function itself before detecting them. There can certainly be value in type-checking parameters and return values, but in this case, I think th

Re: [Python-Dev] removing nested tuple function parameters

2005-09-19 Thread Andrew Koenig
> The only practical reason to like this feature is sparing the need of > finding an otherwise useless name for the formal argument. Another > reason, but not practical at all, is that the concept conveys some > elegance and originality (each programming language should ideally have > a few of the

Re: [Python-Dev] removing nested tuple function parameters

2005-09-19 Thread Andrew Koenig
> I agree that we shouldn't mess with them in 2.x. Yet I think they are > a candidate for being dropped from Py3K. While every feature is used > by *someone* (as the feedback to Brett's query clearly shows) this one > has several things against it. For every user who is fond of them > there are pro

Re: [Python-Dev] removing nested tuple function parameters

2005-09-19 Thread Steven Bethard
Guido van Rossum wrote: > Also, I bet many people will be surprised to know that this code doesn't work: > > add = lambda (x, y): x+y > print add(1, 2) What, an example using lambda syntax that's unintuitive? Never! ;-) STeVe -- You can wordify anything if you just verb it. --- Buc

Re: [Python-Dev] removing nested tuple function parameters

2005-09-19 Thread Guido van Rossum
On 9/19/05, Terry Reedy <[EMAIL PROTECTED]> wrote: > > I consider the current situation to be a consistency feature. To a first > approximation, Python function calls 'pass' objects by name-binding: > > param_name_list = arg_object_list > > Disabling structure unpacking in this assignment would

Re: [Python-Dev] removing nested tuple function parameters

2005-09-19 Thread Terry Reedy
I consider the current situation to be a consistency feature. To a first approximation, Python function calls 'pass' objects by name-binding: param_name_list = arg_object_list Disabling structure unpacking in this assignment would make the language slightly more complex. Someone else posted

Re: [Python-Dev] removing nested tuple function parameters

2005-09-19 Thread Steven Bethard
Greg Ewing wrote: > François Pinard wrote: > > > The only practical reason to like this feature is sparing the need of > > finding an otherwise useless name for the formal argument. > > If the argument represents a coherent enough concept > to be passed in as a tuple in the first place, it > shou

Re: [Python-Dev] removing nested tuple function parameters

2005-09-18 Thread Brett Cannon
On 9/18/05, Greg Ewing <[EMAIL PROTECTED]> wrote: > François Pinard wrote: > > > The only practical reason to like this feature is sparing the need of > > finding an otherwise useless name for the formal argument. > > If the argument represents a coherent enough concept > to be passed in as a tup

Re: [Python-Dev] removing nested tuple function parameters

2005-09-18 Thread Greg Ewing
François Pinard wrote: > The only practical reason to like this feature is sparing the need of > finding an otherwise useless name for the formal argument. If the argument represents a coherent enough concept to be passed in as a tuple in the first place, it should be possible to find a meaningfu

Re: [Python-Dev] removing nested tuple function parameters

2005-09-18 Thread Brett Cannon
On 9/18/05, Raymond Hettinger <[EMAIL PROTECTED]> wrote: > [Brett] > > Is anyone truly attached to nested tuple function parameters; ``def > > fxn((a,b)): print a,b``? > > I am. > > > > > ditching them thanks to the pain they caused in the AST branch. > > Changing the grammar for the convenien

Re: [Python-Dev] removing nested tuple function parameters

2005-09-18 Thread François Pinard
[Raymond Hettinger] > [Brett] > > > Is anyone truly attached to nested tuple function parameters; ``def > > fxn((a,b)): print a,b``? > I am. I like the possibility and use it once in a while, but not often, at least not enough to beg for its preservation, or cry after its loss. Having to go with

Re: [Python-Dev] removing nested tuple function parameters

2005-09-18 Thread Guido van Rossum
> [Brett] > > Is anyone truly attached to nested tuple function parameters; ``def > > fxn((a,b)): print a,b``? [Raymond] > I am. I agree that we shouldn't mess with them in 2.x. Yet I think they are a candidate for being dropped from Py3K. While every feature is used by *someone* (as the feedback

Re: [Python-Dev] removing nested tuple function parameters

2005-09-18 Thread Raymond Hettinger
[Brett] > Is anyone truly attached to nested tuple function parameters; ``def > fxn((a,b)): print a,b``? I am. > ditching them thanks to the pain they caused in the AST branch. Changing the grammar for the convenience of a particular AST implementation carries zero weight with me -- that is t

Re: [Python-Dev] removing nested tuple function parameters

2005-09-18 Thread Nick Coghlan
Brett Cannon wrote: > Is anyone truly attached to nested tuple function parameters; ``def > fxn((a,b)): print a,b``? At one of the PyCon sprints Guido seemed > okay with just having them removed when Jeremy asked about ditching > them thanks to the pain they caused in the AST branch. I personally

Re: [Python-Dev] removing nested tuple function parameters

2005-09-18 Thread Florian Weimer
* Brett Cannon: > Is anyone truly attached to nested tuple function parameters; ``def > fxn((a,b)): print a,b``? At one of the PyCon sprints Guido seemed > okay with just having them removed when Jeremy asked about ditching > them thanks to the pain they caused in the AST branch. Will def fxn

Re: [Python-Dev] removing nested tuple function parameters

2005-09-18 Thread Greg Ewing
Brett Cannon wrote: > Would anyone really throw a huge fit if they went away? I am willing > to write a PEP for their removal in 2.6 with a deprecation in 2.5 if > people are up for it. -1. I don't think this could realistically be done before 3.0, because it would break a lot of existing code f

Re: [Python-Dev] removing nested tuple function parameters

2005-09-17 Thread Steven Bethard
Brett Cannon wrote: > Is anyone truly attached to nested tuple function parameters; ``def > fxn((a,b)): print a,b``? I find 54 instances in my Python installation. >grep -r "def.*([^=]*([^)]*,[^)]*).*):" * aifc.py:def setparams(self, (nchannels, sampwidth, framerate, nframes, comptype, compna

Re: [Python-Dev] removing nested tuple function parameters

2005-09-17 Thread Andrew Bennetts
On Sat, Sep 17, 2005 at 06:20:08PM -0700, Brett Cannon wrote: > Is anyone truly attached to nested tuple function parameters; ``def > fxn((a,b)): print a,b``? At one of the PyCon sprints Guido seemed > okay with just having them removed when Jeremy asked about ditching > them thanks to the pain th

[Python-Dev] removing nested tuple function parameters

2005-09-17 Thread Brett Cannon
Is anyone truly attached to nested tuple function parameters; ``def fxn((a,b)): print a,b``? At one of the PyCon sprints Guido seemed okay with just having them removed when Jeremy asked about ditching them thanks to the pain they caused in the AST branch. I personally don't see them being overly